ps1

Pinging via IPv4

All PowerShell versions You can use ping.exe just like any other command inside PowerShell scripts. By adding “-4” to the command line,...

read more

Testing UNC Paths

Test-Path can test whether or not a given file or folder exists. This works fine for paths that use a drive letter, but can fail with pure UNC...

read more

Change Order of CSV Columns

If you have a CSV file and would like to change the order of columns, simply import it into PowerShell, use Select-Object to change the order, and...

read more

Ignoring Empty Lines

To read in a text file and skip blank lines, try this: $file = 'c:\sometextfile.txt' Get-Content $file | Where-Object { $_.Trim() -ne...

read more

HTML-Scraping with RegEx

To scrape valuable information from websites with PowerShell you can download the HTML code and then use regular expressions to extract what you are...

read more