Get-PSSubsystem
擷取 PowerShell 中註冊之子系統的相關信息。
Syntax
Get-PSSubsystem []
Get-PSSubsystem
-Kind <SubsystemKind>
[<CommonParameters>]
Get-PSSubsystem
-SubsystemType <Type>
[<CommonParameters>]
Description
擷取 PowerShell 中註冊之子系統的相關信息。
注意
這是實驗性的功能。 只有在啟用此功能時, PSSubsystemPluginModel
才能使用此 Cmdlet。 如需詳細資訊,請參閱使用實驗性功能。
並讓您將 System.Management.Automation.dll
的元件區分為本身組件中的個別子系統。 這種區隔可減少核心 PowerShell 引擎的磁碟使用量,並讓這些元件成為選用功能,只需安裝最低版本的 PowerShell。
目前僅支援 CommandPredictor 子系統。 這個子系統可搭配使用 PSReadLine 模組,以提供自訂預測外掛程式。 未來,您可以將 Job、CommandCompleter、Remoting 和其他元件區分為 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
。
Type: | SubsystemKind |
Accepted values: | CommandPredictor |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SubsystemType
指定要傳回的子系統類型。
Type: | Type |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |