A class is a .NET type: a definition of functioning software that describes how to interact with it. An instance is a concrete implementation of that class, such as a particular running process. Classes contain members, including properties, methods, and events. section 25.1.1
Use these distinctions when exploring .NET objects from PowerShell:
- Properties describe what an object represents; some can be changed, while others are read-only. section 25.1.1
- Methods perform actions and can accept arguments, much like command parameters. section 25.1.1
- Events signal that something happened to an instance, although PowerShell offers limited event-driven support. section 25.1.1
- Abstract classes can provide functionality without a concrete instance; static members are accessed directly through the class. section 25.1.1 section 25.2
Call a class from PowerShell
PowerShell identifies .NET types with square brackets and accesses static members with double colons. For example, [Math]::Abs(-5) calls the static Abs method without creating a Math instance. Instance-based classes work differently: load the required assembly, create an object with New-Object, and call its method, as with a SpeechSynthesizer object's Speak method. section 25.2 section 25.6
[Math]::Abs(-5)
See the compact PowerShell example for invoking a static class member. section 25.2




















