Powershell

Parsing Raw Text (Part 3)

In the previous tip we illustrated how you can use Select-String to find lines in raw text containing a specific word. It took some effort to...

read more

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

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
1 47 48 49 50 51 130