PowerShell Genie

PowerShell Classes

PowerShell 5.0+ supports real classes — type safety, encapsulation, and cleaner code.

Basic Class

class Server {
    [string]$Name
    [string]$IPAddress
    Server([string]$name, [string]$ip) {
        $this.Name = $name
        $this.IPAddress = $ip
    }
}
Genie guidePowerShell Classes

Write PowerShell classes: properties, methods, constructors, inheritance, and practical class-based scripting.

Stuck? Re-read the section, then try the filter yourself.