How to get current class name/object inside PowerShell static class method? How to get current class name/object inside PowerShell static class method? powershell powershell

How to get current class name/object inside PowerShell static class method?


Static classes do not have this pointer. See MSDN

Static member functions, because they exist at the class level and not as part of an object, do not have a this pointer. It is an error to refer to this in a static method.

You must call method by class name.