Sometimes, we need to develop several versions of modules for different PowerShell versions or Windows versions. We have two or more versions of the module that we need to be able to load in order to support users and do development.
The PSModulePath
variable contains a semicolon-delimited list of folder paths that PowerShell searches for modules. Some people may think of a PowerShell module as basically a .dll
(binary module), .psm1
(script module), or .psd1
(manifest module) file, but it's never just one file; it's a group of folders and files. In order for PowerShell to find the PSNet
module when you type Import-Module PSNet
, you have to set up a folder in PSModulePath
named PSNet
and also a file (.dll
, .psm1
, or .psd1
) named PSNet
.
As we all know, PowerShell has a -version
parameter that is used to specify the PowerShell version. We can execute this in the console as follows:
powershell.exe -version 3.0