All of the members demonstrated so far have required creation of an instance of a type using either New-Object or ::new().
Static members may be executed without creating an instance of a type (based on a class).
Classes may implement static properties and static methods using the Static modifier keyword:
class MyClass {
static [String] $Property = 'Property value'
static [String] Method() {
return 'Method return'
}
}
The static members are invoked as follows:
[MyClass]::Property
[MyClass]::Method()
The Hidden modifier may be used in conjunction with the Static modifier. The modifiers may be used in either order.