I just learned to include C# code into Powershell and use Add-Type to get it compiled and loaded. However when I implemented a class that is a singleton, I failed to find reference as to how to use it.
If it is a normal class, we can use New-Object. What do we do with singleton where you have to access it by Instance()?
A typical singleton provides a static method to access the singleton instance. So you would use PowerShell’s static method invocation syntax e.g.: