What's the difference between Add-PsSnapIn and Import-Module

前端 未结 5 1214
孤独总比滥情好
孤独总比滥情好 2020-12-24 06:11

Powershell has two means for importing additional cmdlets into a session, Add-PsSnapIn and Import-Module. The docs are not at all clear regarding when one would chose one ov

5条回答
  •  借酒劲吻你
    2020-12-24 06:39

    Add-PSSnapin and Import-Module are used to take external 3rd party libraries(Script files/ binary files/ dll) in the current PowerShell session. Modules are little more easier to use than PSSnapins.

    The main advantage module over PSSnapin is we can't remove or unload PSSnapin from the current PowerShell session once it is added. But modules can be removed from the current PowerShell session manually, using Remove-Module

    NOTE: The concept PSSnapin introduced in PS version 1.0 and module introduced in PS version 2.0.

    Ref:- This

提交回复
热议问题