Get-PSSubsystem
擷取 PowerShell 中註冊的子系統資訊。
語法
GetAllSet (預設值)
Get-PSSubsystem
[<CommonParameters>]
GetByKindSet
Get-PSSubsystem
-Kind <SubsystemKind>
[<CommonParameters>]
GetByTypeSet
Get-PSSubsystem
-SubsystemType <Type>
[<CommonParameters>]
Description
擷取 PowerShell 中註冊的子系統資訊。
Note
這是實驗性功能。 此指令只有啟用此功能時 PSSubsystemPluginModel 才可用。 欲了解更多資訊,請參閱 「使用實驗特徵」。
此功能可讓您將的 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。
參數屬性
| 類型: | 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。