database-tools

Parsing Raw Text (Part 2)

In the previous tip we explained how you can use Select-String and a regular expression to extract valuable information from raw text results: PS...

read more

Parsing Raw Text (Part 1)

Sometimes, you may want to extract valuable information from pure text results. One easy way is the use of Select-String. This example extracts only...

read more

Adjusting Simple UIs

In the previous tip you learned how you can use Show-Command to create simple UIs for text-based commands: #requires -Version 3.0 function...

read more

Creating Simple UIs

Function and cmdlet parameters basically are the technique how PowerShell creates „user interfaces“. These text-based interfaces can...

read more

Extending Robocopy

PowerShell can add value to existing commands such as robocopy. Take a look at the below function--it uses robocopy to copy files, and adds the...

read more

Copy Color-Coded Code

When you select code in the PowerShell ISE and copy it to the clipboard, it is copied in RTF format and preserves all color coding and font...

read more
Run Book, Run!!!

Run Book, Run!!!

  How many of you actually have a “Hit-by-the-Bus” handbook? What is that, you ask? It is a document that explains how to execute all your jobs and...

read more

Capturing Linux Output

If you run PowerShell on Linux, you can combine Linux and PowerShell commands. To take the output of a Linux command and assign it to a PowerShell...

read more

Test for File or Folder

Test-Path can check whether a file or folder exists. If you add -PathType and specify Leaf (for files) or Container (for folders), the result can be...

read more

Creating Time Spans

You can use New-TimeSpan to define “amounts” of time, and then add or subtract them from dates. Here is an example: $1Day = New-TimeSpan...

read more

Finding Unapproved Verbs

Cmdlets and functions should use only approved verbs to make it easier on user to find commands, and improve consistency. Here is quick audit code...

read more
1 93 94 95 96 97 198