How it works...
Static members of classes often contain helper methods and useful properties. There is one static method that most people with even a very short background in programming will know of, and that is public static void main (string[] args), which is used as the main entry point in a program in Java and C#.
In this recipe, you have used various static methods and properties to your advantage. You started in Step 1 by accessing the static method Beep in the console class to emit a sound. While not necessarily very useful, it is an easy example of a static method, or a method that does not require an object to work.
In Step 2, you saw that Get-Member is also available for discovering static members of a class. Steps 3 to 5 showed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access