In a previous tip you learned how PowerShell can list all available time zone IDs. Today, we show you how to set the time zone using the utility...
posts
Get Time Zone Info
There is a little known utility called tzutil.exe which can both set the current time zone and get all available time zones. Today, let's check...
Finding Office Installation Path
Microsoft Office has many different versions and exists as a 32-bit and 64-bit edition. Finding the installation path with PowerShell can still be...
Hiding Code from ISE Debugger
Typically, when you set breakpoints in your script and then step through your code using F11 or "Debug/Step Into", the debugger will visit...
Exploring PowerShell "Suggestions"
In the PowerShell console, you may have noticed "suggestions" that appear with common errors. Suggestions are designed to help you better...
Analyzing PowerShell Errors
PowerShell logs all errors in $error variable (unless the cmdlet uses -ErrorAction Ignore). $error contains the error records which in turn contain...
Using Script Validators with Variables
As pointed out in a previous tip, PowerShell 3.0 now supports the use of validators for variable assignments. This is a great way of ensuring that a...
Waiting for Service State
Most high-level cmdlets dealing with services have built-in code to wait for state changes. So when you run Restart-Service to restart a service,...
Controlling Numeric Range for Variables
In a previous tip we illustrated how in PowerShell 3.0, you can now use validators to restrict the data that can be assigned to a variable. Here is...
Killing All Remote PowerShell Sessions
In a previous tip we explained how you can enumerate who is connected to your machine via PowerShell Remoting, and how you can terminate individual...
Killing Remote PowerShell Sessions
To kill a remote PowerShell session that runs on your machine, you could kill the wsmprovhost.exe task associated with it, but identifying the...
Finding Remote Sessions Connected to Your Machine
Ever wanted to find out who is running a (hidden) remote PowerShell on your machine? Here's a simple one-liner: Get-WSManInstance -ConnectionURI...