Loading the Snap-In
Loading the Snap-In
Note: starting with version 2.0 of Windows PowerShell, there is the - more modern - possibility to provide extensions also in the form of so-called modules. We therefore recommend using the PowerShell Extensions as a module. |
Note: Windows PowerShell versions 6.0 and later no longer support the concept of Snap-Ins. So, if you want to use PSX with PowerShell 6 or 7, it is mandatory to use the module loading. |
If you start the PowerShell console by clicking the associated shortcut in the start menu or by executing the command Powershell.exe the PowerShell Extensions for Ivanti DSM will not be loaded and the cmdlets therefore can not be used.
If you want to use PowerShell Snap-Ins provided by third party vendors in your scripts or in interactive console sessions you have to load them first. There are several approaches to load Snap-Ins:
- Open the PowerShell console by clicking the shortcut that was created during the installation process of the PowerShell Extensions for Ivanti DSM (the shortcut is only available if the feature Shortcut was selected during the installation process).
- Open the PowerShell console and execute the following command:
Add-PSSnapin NwcServices.BlsAdministration |
- Append commands for loading the Snap-In to your PowerShell profile. The profile will be executed every time you start an interactive PowerShell session, so the Snap-In will be loaded automatically.
Further information about PowerShell profiles is available at http://technet.microsoft.com/en-us/magazine/2008.10.windowspowershell.aspx - Load the Snap-In by hand and use the cmdlet Export-Console to export the current PowerShell configuration. The created XML file can be applied to the parameter -PSConsoleFile of the PowerShell executable. This approach is further explained in the article http://www.wrox.com/WileyCDA/Section/Extending-Windows-Powershell-with-Snap-ins.id-320555.html (scroll down to the section "Saving Snap-in Configuration").
For convenience you might consider creating a shortcut, to apply the parameter to the executable. This is equivalent to the approach the installer
implemented if you had selected the shortcut feature during the installation process.