6
可能重複:
What’s the difference between Add-PsSnapIn and Import-ModulePowerShell中的Add-PSSnapin和Import-Module有什麼區別?
是什麼PowerShell中Add-PSSnapin
和Import-Module
之間的區別?
最後,兩人似乎都提供了相同的結果。
哪一個是推薦的方法?
可能重複:
What’s the difference between Add-PsSnapIn and Import-ModulePowerShell中的Add-PSSnapin和Import-Module有什麼區別?
是什麼PowerShell中Add-PSSnapin
和Import-Module
之間的區別?
最後,兩人似乎都提供了相同的結果。
哪一個是推薦的方法?
PsSnapins是舊時尚的方式(現有inPowerShell V1)添加cmdlet或供應商(但仍在使用)
模塊是新的方式(在PowerShel V2添加)來添加cmdlet或供應商
它存在一個清單表單,它允許指定有關創建者的許多信息,但也包括PowerShell版本,Framework版本或其他模塊或程序集版本上的依賴關係。
我認爲你可以使用模塊,除非你必須支持現有的PowerShell V1計算機。
我推薦http://www.simple-talk.com/dotnet/.net-tools/further-down-the-rabbit-hole-powershell-modules-and-encapsulation/。沒有關於插件的信息,只是模塊,對於除了MS遺留代碼(如SQL插件和TFS插件)以外的其他應用程序,IIUC是推薦的方法。 – yzorg
乾淨清爽 - http://blogs.technet.com/b/aviraj/archive/2011/12/04/powershell-using-modules-and-snap-ins-what-s-the-difference-between-modules -AMP-管理單元ins.aspx –