February 2019
Intermediate to advanced
626 pages
15h 51m
English
Modules are added using the ImportPSModule method of InitialSessionState:
$initialSessionState = [InitialSessionState]::CreateDefault2()$initialSessionState.ImportPSModule('Pester')
Several modules can be added with the same method. Modules can be specified by name, in which case the most recent will be used. A module may be specified using a hashtable that describes a name and version information:
$initialSessionState.ImportPSModule(@( 'NetAdapter' @{ ModuleName = 'Pester'; ModuleVersion = '4.6.0' }))
MaximumVersion and RequiredVersion may also be used with the hashtable.
A snap-in may be imported in Windows PowerShell using the ImportPSSnapIn method. The method requires the name of a single snap-in, and a reference ...
Read now
Unlock full access