Accessing Static .NET

by Dec 17, 2008

You can start to explore the power of .NET with PowerShell's built-in .NET access.. All you will need are square brackets to access static classes. For example, here is a code snippet that resolves a host name:

[system.net.Dns]::GetHostByName('microsoft.com')

Using PowerShell Plus, you can find out what .NET classes and methods are available. It will show code completion once you enter a "::" after a type (in square brackets) or "." after an object or variable for dynamic members.