PowerShell Add-Type jika tidak ada

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