Possible Duplicate:
What’s the difference between Add-PsSnapIn and Import-Module
What is the difference between Add-PSSnapin
and Import-Module
in PowerShell?
At the end, both seem like they provide the same result.
Which one is the recommended approach?
Description. The Add-PSSnapin cmdlet adds registered Windows PowerShell snap-ins to the current session. After the snap-ins are added, you can use the cmdlets and providers that the snap-ins support in the current session.
Description. The Import-Module cmdlet adds one or more modules to the current session. Starting in PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the Import-Module command to import a module.
PsSnapins are the old fashion way (existing inPowerShell V1) to add CmdLet or Providers (but still in use)
Modules are the new way (added in PowerShel V2) to add CmdLet or Providers
It exists a manifest form that allow to specify much information about the creator, but also the dependancies on PowerShell versions, Framework version or other modules or assemblies version.
I think that you can use module unless you have to support existing PowerShell V1 computers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With