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:
![](https://static.packt-cdn.com/products/9781787126305/graphics/cd4dc4ab-81f1-4bd7-8578-dedc2c633e24.png)
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...