Static methods
As static properties, static method do not require that an instance of a class is created.
MSDN shows static methods using an S
symbol in the left-most column. For example, the System.Net.NetworkInformation.NetworkInterface
class has a number of static methods. The first of these is shown in the following screenshot:
PowerShell is also able to list these methods using Get-Member
with the Static
switch:
PS> [System.Net.NetworkInformation.NetworkInterface] | Get-Member -MemberType Method -Static TypeName: System.Net.NetworkInformation.NetworkInterface Name MemberType Definition ---- ---------- ---------- Equals Method static bool Equals(System.Object objA, System.Object objB) GetAllNetworkInterfaces Method static System.Net.NetworkInformation.NetworkInterface[] GetAllNetworkInterfaces() GetIsNetworkAvailable Method static bool GetIsNetworkAvailable() ReferenceEquals Method static bool ReferenceEquals...