Hopefully a very simple question. I'm diving into classes within PowerShell; What I'm wondering is normally you estantiate a class as Class <myClass> {}
is there a way to write it like the system ones System.Collections.Generic....
. So it would be something akin to:
class <myCompany>.<myClass> {}
?
PowerShell classes cannot be namespaced with native syntax, you'll need to compile your types from C# using Add-Type
:
Add-Type -TypeDefinition @'
namespace MyCompany {
public class MyClass { }
}
'@