PowerShell - Catching Errors
When you want to catch errors produced by cmdlets, always make sure you add the parameter -ErrorAction Stop to it.
Research and Development
When you want to catch errors produced by cmdlets, always make sure you add the parameter -ErrorAction Stop to it.
Ever wanted to read out the Windows license key? In the Windows Registry, this key is present, but it is stored as a digital ID.
If you want to know whether your script has currently full Administrator privileges, here is an one-liner that tells you.
By default, all variables created in functions are local, so they only exist within that function and all functions that are called from within this function.
Tired of using the boring default fonts in PowerShell? There are more monospaced fonts on your system. You just need to allow the console to use them.
If your machine has more than one Internet connection at the same time, which connection is used?
You might know the more tool - when you pipe output to more, the output is displayed page by page.
Here is a sample that uses the live.com freemailer (formally Hotmail) which requires a secure connection.
To find out when a system restarted and why, use the below code to extract the relevant information from the System event log.
The Start-Process cmdlet has no -ComputerName parameter, so WMI can be used instead.