You should use Trace-Command: if you are ever in doubt about just how PowerShell binds cmdlet parameters to a cmdlet Trace-Command -psHost -Name...
database-tools
Mixing Parameter Sets
You will find that some cmdlet parameters belong to different parameter sets. Any cmdlet can use only parameters from one parameter set. You will...
Secret Parameter Alias Names
It is important to note that cmdlet parameters can have assigned alias names. They are not always easy to find but they are there. This is why you...
Cmdlet Alias
For most cmdlets, there are convenient shortcut names that are the alias names. So whenever you find yourself using a new cmdlet, you should take a...
Copying Help Information (or other things) to Clipboard
Most people aren't aware that Windows comes with a small application called clip.exe (introduced in Windows Vista). You can use it within the...
Visiting Help Topics
All Help topics inside of PowerShell are stored as plain text files. You can read them by using Get-Help, but you can also more easily open the...
Dangerous Keystroke
You are probably aware of CTRL+C to break the current command. However, you should beware of CTRL+BREAK! This key shortcut will not only break the...
Getting Advanced Help
While Get-Help does not just document cmdlets, it also allows you to find out more about general PowerShell concepts: Get-Help about_* For example,...
Getting Paginated Help
Reading Help information using Get-Help is great, but often (especially when specifying the -full or -detailed switch parameter), you retrieve so...
Childproofing PowerShell
If you are new to PowerShell, you may be worried about causing unwanted damage or change. One way of childproofing PowerShell is by changing the...
Find Potentially Harmful Cmdlets
Any cmdlet that can change and potentially damage your system supports the -whatif parameter, allowing you to just simulate the action without...
Use the Force!
Many cmdlets support the -force switch parameter. With it, the cmdlet will do more than usual. What exactly -force does depends on the cmdlet. For...
Listing Program Versions
You may already know about the Get-Process cmdlet, which lists all running processes, locally and remotely (use -computername for remote access)....
Using Relative Dates
Sometimes, you need relative dates. What date was 14 days ago? Maybe you want to use this relative date to select files of a certain age. You can...
Creating Temporary File Names
Get-Date not only will retrieve the current date, but you can also construct a custom date format to create time-stamped temporary file names:...
Getting Hotfix Information
PowerShell v.2 comes with a new cmdlet called Get-Hotfix. It retrieves for you all installed hotfixes and updates. You can use it locally or...
Validating Input Type
The -as parameter is not widely known but is extremely versatile. It tries to convert data into a .NET type, and when it fails, it simply returns...
Speeding Up Remote Inventory
Get-WMIObject is a fantastic cmdlet to query information locally and on remote systems. Have a look: Get-Content c:\management.txt |ForEach-Object {...
Enabling Block Cursor
How would you like to get back the big ugly block cursor you may know from Commodore 64-systems? Here is a way: $Host.UI.RawUI.CursorSize = 100...
Resolve Host Names
Have you ever needed to resolve a host name to find its IP address? Simply use a .NET method and wrap it as PowerShell function: function...
Creating "Constant" Functions
When you make a function read-only, it can no longer be overwritten but you would still be able to delete the function and recreate it from scratch....
Adding Write Protection to functions
Functions by default have no write protection so they can easily be overwritten and redefined. You should do this if you'd like to make a...
Converting Database Records into PowerShell objects
When you access a database, the result is not automatically wrapped as objects so you cannot pipe the result into other cmdlets like Sort-Object or...
Opening Databases from PowerShell
The easiest way of accessing databases right from PowerShell is to visit control panel and open the Data Sources (ODBC) module (which resides in...