måndag 6 december 2010

typeof() in PowerShell

Today I needed to check if an object was of a specific type in PowerShell. The typeof() statement doesnt work, you should use [ ] instead. Like this:
$feature.Parent.GetType() -eq [Microsoft.SharePoint.Administration.SPFarm]

Inga kommentarer:

Skicka en kommentar