StackOverflow 文档 PowerShell 教程 PowerShell 类 构造函数重载 构造函数重载 Created: November-22, 2018 class Person { [string] $Name [int] $Age Person([string] $Name) { $this.Name = $Name } Person([string] $Name, [int]$Age) { $this.Name = $Name $this.Age = $Age } } 获取实例的所有成员方法和属性