Windows PowerShell 嵌入式管理單元提供一個機制,可註冊一組 Cmdlet 和另一個 Windows PowerShell 提供者與殼層,進而擴充殼層的功能。 Windows PowerShell 嵌入式管理單元可以在單一元件中註冊所有 Cmdlet 和提供者,也可以註冊特定的 Cmdlet 和提供者清單。
嵌入式管理單元元件應該安裝在受保護的目錄中,就像其他作系統一樣。 否則,惡意使用者可以使用不安全的程式代碼取代元件。
Windows PowerShell 嵌入式管理單元類別
所有 Windows PowerShell 嵌入式管理單元類別都衍生自 System.Management.Automation.PSSnapIn 或 System.Management.Automation.CustomPSSnapIn 類別。
範例
撰寫 Windows PowerShell 嵌入式管理單元:此範例示範如何建立嵌入式管理單元,以用來註冊元件中的所有 Cmdlet 和提供者。
撰寫自定義 Windows PowerShell 嵌入式管理單元:此範例示範如何建立自定義嵌入式管理單元,以用來註冊單一元件中可能或可能不存在的特定 Cmdlet 和提供者集合。
另請參閱
System.Management.Automation.PSSnapIn