Get-PSSubsystem
检索有关 PowerShell 中注册的子系统的信息。
语法
Get-PSSubsystem []
Get-PSSubsystem
-Kind <SubsystemKind>
[<CommonParameters>]
Get-PSSubsystem
-SubsystemType <Type>
[<CommonParameters>]
说明
检索有关 PowerShell 中注册的子系统的信息。
注意
这是一项实验性功能。 此 cmdlet 仅在启用 PSSubsystemPluginModel
功能时才可用。 有关详细信息,请参阅 使用实验功能。
利用此功能,可以将 System.Management.Automation.dll
的组件分离到驻留在其自己的程序集中的单个子系统中。 这种分离可减少核心 PowerShell 引擎的磁盘占用量,并允许这些组件成为最小 PowerShell 安装的可选功能。
目前,仅支持 CommandPredictor 子系统。 此子系统与 PSReadLine 模块一起使用以提供自定义预测插件。 将来,作业、CommandCompleter、远程处理 和其他组件可以拆分为 System.Management.Automation.dll
之外的子系统程序集。
示例
示例 1 - 显示所有可用的子系统
Get-PSSubsystem
Kind SubsystemType IsRegistered Implementations
---- ------------- ------------ ---------------
CommandPredictor ICommandPredictor False {}
示例 2 - 显示特定类型的所有可用子系统
PS> Get-PSSubsystem -Kind CommandPredictor | Format-List
Kind : CommandPredictor
SubsystemType : System.Management.Automation.Subsystem.ICommandPredictor
AllowUnregistration : True
AllowMultipleRegistration : True
RequiredCmdlets : {}
RequiredFunctions : {}
IsRegistered : False
Implementations : {}
参数
-Kind
指定要返回的子系统的类型。 有效值为:CommandPredictor
。
类型: | SubsystemKind |
接受的值: | CommandPredictor |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SubsystemType
指定要返回的子系统的类型。
类型: | Type |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |