I noticed that I needed to quickly brush up on PowerShell and as a result, I decided to throw together a quick simple quick reference project to better familiarize myself with the PowerShell scripting language used primarily in Windows environments.
This quick reference project incorporates:
- Command line input parameters
- Reading from a JSON configuration file
- Writing to the console with Write-Host
- Flow control with if, elseif, and else
- Loop iteration with foreach
- Functions with parameters
- Exception handling and throwing with try, catch and finally
- Printing out errors using the $Error automatic variable
- Switch statements
- Enabling and disabling Set-PSDebug
- Unordered and ordered Hashtables
- Sorting unordered hashtables into sorted ordered hashtables
- Filtering out hashtable columns
- Writing to a CSV file
Leave a Reply