Windows 7 SP1 with PowerShell v2 cannot upgrade to PowerShell v3
ContactOwners
Failure
Sumitting through https://community.chocolatey.org/packages/PowerShell/ContactOwners, even in an anonymous browser window, got me
reCAPTCHA Error(s): Suspicious behavior detected. Sometimes this misidentifies legitimate requests. If this request is legitimate, please visit our Gitter channel to reach out to our team." even in an anonymous browser window.
So via a small Gitter thread, I got to here.
Message
To: Mark.Michaelis, DarwinJS
Hi Mark, Darwin,
I know that on Windows 7 with stock PowerShell 2.0, errors like "You must provide a value expression on the right-hand side of the '-' operator." can happen with individual packages.
In the past, the solution was to install https://community.chocolatey.org/packages/PowerShell/3.0.20121027 using choco upgrade --yes powershell --version=3.0.20121027
That currently fails with the same error, despite the requirements at https://docs.chocolatey.org/en-us/choco/setup#requirements
Windows 7+ / Windows Server 2003+ PowerShell v2+ (Not PowerShell Core yet though)(minimum is v3 for install from this website due to TLS 1.2 requirement) .NET Framework 4+ (the installation will attempt to install .NET 4.0 if you do not have it installed) (minimum is 4.5 for install from this website due to TLS 1.2 requirement)
The full log of choco upgrade --yes powershell --version=3.0.20121027 --debug --verbose: is at https://gist.github.com/jpluimers/7aed9b9feb05b6a22a6e2103c234b24f
Replacing upgrade by install and running choco install --yes powershell --version=3.0.20121027 --debug --verbose gives the same error.
I found, https://github.com/DarwinJS/ChocoPackages/tree/master/PowerShell, which points to https://gitlab.com/DarwinJS/ChocoPackages/tree/master/openssh, then found https://gitlab.com/DarwinJS/ChocoPackages/-/tree/master/PowerShell and the script at https://gitlab.com/DarwinJS/ChocoPackages/-/blob/master/PowerShell/v3.0/tools/ChocolateyInstall.ps1
That one does not seem to have suspicious operators like -in which are unavailable to PowerShell v2.
My current condition (still recovering from extensive rectum cancer treatment) isn't well enough to do the same for https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/chocolateyInstaller.psm1 and all files under https://github.com/chocolatey/choco/tree/master/src/chocolatey.resources/helpers/functions
Can you please try to help me out on this one?
What is the suggested way to still upgrade to PowerShell v3 on Windows 7?
Regards,
--jeroen