When you use PowerShell, you often need to import snapin and module to help with some operations.
such as the following two kinds of operations:
1 We manage users by invoking the Active Directory module
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// Img1.51cto.com/attachment/201408/14/705126_1408002161oyxu.png "height="/>
2 Manage mailboxes by importing Exchange Snapin
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// Img1.51cto.com/attachment/201408/14/705126_1408002162cznm.png "height=" 205 "/>
But what is snapin and module?
From the example above, both are extensions of PowerShell. On MSDN Snapin Translated as: "Snap-in", module translated to "Components".
The snapin was introduced in PowerShell 1.0, and module was introduced in PowerShell 2.0.
Core difference: module can replicate the deployment directly, but the snapin must be registered before use. For example, someone gave you a snapin you have to use the. NET Installutil.exe tools to register, you can add-pssnapin after registration, and if someone gave you a Module, you can copy it import-module.
The snapin must be dll,vb,c# compiled, but the module can be a PS script file, in addition to being a DLL.
Because of the 3rd and 4th differences, module is more convenient than snapin, flexible, MS was a lot of old snapin in the new version of the changed, became module