Get-PSSubsystem

检索有关 PowerShell 中注册的子系统的信息。

语法

GetAllSet (默认值)

Get-PSSubsystem
    [<CommonParameters>]

GetByKindSet

Get-PSSubsystem
    -Kind <SubsystemKind>
    [<CommonParameters>]

GetByTypeSet

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
默认值:None
接受的值:CommandPredictor
支持通配符:False
不显示:False

参数集

GetByKindSet
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SubsystemType

指定要返回的子系统的类型。

参数属性

类型:Type
默认值:None
支持通配符:False
不显示:False

参数集

GetByTypeSet
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

SubsystemKind

Type

输出

SubsystemInfo