Snapin and module in PowerShell

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.