You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the PowerShell helpers.ps1.erb template, the Get-Win32OS function is called to collect Windows OS details via WMI and return the results as an object with properties.
However, the function goes on to set the object result into a Windows system environment variable: $env:win32OS. Doing so converts the object to a string, using only the Caption property. Any other properties are discarded and are no longer available.
This causes the Get-PlatformVersion and Get-PlatformArchitecture functions to return invalid results.
Changing lines 29 to 35 to use a PowerShell variable such as $win32OS, as opposed to an environment variable $env:win32OS, should return the Get-Win32OS function back to expected behavior.
In the PowerShell
helpers.ps1.erb
template, theGet-Win32OS
function is called to collect Windows OS details via WMI and return the results as an object with properties.However, the function goes on to set the object result into a Windows system environment variable:
$env:win32OS
. Doing so converts the object to a string, using only theCaption
property. Any other properties are discarded and are no longer available.This causes the
Get-PlatformVersion
andGet-PlatformArchitecture
functions to return invalid results.Changing lines 29 to 35 to use a PowerShell variable such as
$win32OS
, as opposed to an environment variable$env:win32OS
, should return theGet-Win32OS
function back to expected behavior.mixlib-install/lib/mixlib/install/generator/powershell/scripts/helpers.ps1.erb
Lines 29 to 35 in 7957417
The text was updated successfully, but these errors were encountered: