[wix-users] Wrong Powershell version

Edwin Castro egcastr at gmail.com
Sat Jul 18 17:38:19 PDT 2020


The WixPSExtension looks at the PowerShellVersion value in the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine key to
populate the POWERSHELLVERSION property.

On my system
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine shows
the correct expected version.

C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


C:\> Get-Host | Select-Object Version

Version
-------
5.1.18362.145


C:\> Get-ItemProperty
HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine | Select-Object
PowerShellVersion

PowerShellVersion
-----------------
2.0


C:\> Get-ItemProperty
HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine | Select-Object
PowerShellVersion

PowerShellVersion
-----------------
5.1.18362.1


C:\>

--
Edwin G. Castro


On Sat, Jul 18, 2020 at 4:29 PM Roberto via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Hi,
>
> I have the following in my product.wxs to check the installed PSVERSION on
> my machine
>
> // WixPSExtension
> <PropertyRef Id="POWERSHELLVERSION" />
>     <Condition Message="[POWERSHELLVERSION]">
>       <![CDATA[Installed OR POWERSHELLVERSION <= "1.0"]]>
>     </Condition>
>
> During install it shows:  2.0
>
> Get-Host | Select-Object Version gives me:
>
> Version
> -------
> 5.1.18362.752
>
> What is wrong with my XML?
>
> Also I don't understand the condition from above:
>
> 1. Installed - For me it sounds like, if is installed (but in reality it
> executes only if "not installed")
> 2. why `or` ?
>
>
>
>
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list