Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell add-type if not exists

if (-not ([System.Management.Automation.PSTypeName]'MyClass').Type)
{
    Add-Type -TypeDefinition 'public class MyClass { }'
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #powershell #exists
ADD COMMENT
Topic
Name
2+3 =