PowerShell Add-Type, jeśli nie istnieje

if (-not ([System.Management.Automation.PSTypeName]'MyClass').Type)
{
    Add-Type -TypeDefinition 'public class MyClass { }'
}
Naughty Nightingale