Use PowerShell Cmdlets!

by Jul 19, 2010

Whenever possible, try to avoid raw .NET access if you would like to create more readable code. For example, the following line returns the current date:

[System.DateTime]::Now

Here is a much better approach: simply use Get-Date:

Get-Date

Remember: Raw .NET access is the last resort if no appropriate cmdlet is available.

Twitter This Tip! ReTweet this Tip!