Powershell

Creating New Objects

There is a powerful new way in PowerShell v.2 to create new objects from scratch: You should first get yourself an empty hash table object, then add...

read more

Exit a Script Immediately

Use the Exit statement if you run into a condition where a script should quit. The script breaks whenever you call exit from within your script. Add...

read more

Using Real Registry Keys

In PowerShell, you access registry keys through virtual drives like HKCU: (for HKEY_CURRENT_USER) and HKLM: (representing HKEY_LOCAL_MACHINE). You...

read more

Writing to the Registry

Adding or changing registry values is not always intuitive with PowerShell. Here is a function called Set-RegistryValue that will make your life...

read more

Reading Registry Values

In PowerShell, you will need to use one of the Registry virtual drives to read from the Windows Registry as it is - not always intuitive. Here are...

read more

Analyze Parameter Binding

You probably know that PowerShell is pretty flexible when it comes to parameters you want to submit to cmdlets and functions. You can name them...

read more

Using Comment-Based Help

PowerShell v.2 allows your functions to seamlessly integrate with the built-in PowerShell Help system. All you need to do is a Comment-Based- Help...

read more

Using Block Comments

Another new feature in PowerShell v.2 is the introduction of a new block comment. Basically, anything you place between <# and #> will be...

read more

Creating Custom Objects

PowerShell v.2 has a new trick for creating your very own objects that you can then pass to other cmdlets. It is a two-step process. First, create a...

read more