Windows PowerShell 提供抽象类和接口,使你能够创建自定义交互式 UI 来托管 Windows PowerShell 引擎。 若要创建自定义 UI,必须实现 System.Management.Automation.Host.PSHost 类。 (可选)还可以实现 System.Management.Automation.Host.PSHostRawUserInterface 和 System.Management.Automation.Host.PSHostUserInterface 类, 和 System.Management.Automation.Host.IHostSupportsInteractiveSession 和 System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection 接口。