Summary
What's the difference between the PowerShell Module Manifest values PowerShellVersion
and PowerShellHostVersion
?
Long Version
When creating a new module manifest there are settings for both the minimum version of PowerShell required by this module, and also the minimum version of the PowerShell Host required. i.e.
New-ModuleManifest -Path '.\MyModule.psd1' -PowerShellVersion '5.0' -PowerShellHostVersion '2.0'
PowerShellVersion
relates to $PSVersionTable.PSVersion.Major
(NB: Relates to the major version since valid values all have 0 set for their minor version / no build or revision numbers).
PowerShellHostVersion
is the one I'm not clear on. My belief is that this relates to $Host.Version
(i.e. with PowerShellHostName
relating to $Host.Name
). However, in my experience both ISE (Windows PowerShell ISE Host
) and ConsoleHost
have their version numbers inline with the PS version; so it seems odd to require that these be out of sync with the PS version as implied in the example. My hope is these are rarely used parameters for rare use cases; but I want to ensure I've understood correctly what these are for, and if there is a common scenario where they're applicable.
The example values in MSDN's documentation differ (i.e. PowershellVersion
is given 5.0
, whilst PowershellHostVersion
gets 2.0
)
The Official Documentation just gives a circular description (i.e. adds no more information than the parameter name itself implies).