-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSInternals Chocolatey package has wrong PowerShell dependency #85
Comments
Hi @bcurran3 , thanks for feedback. I actually did that intentionally because of these RTM OS versions:
They already contain PowerShell v3 or v4 preinstalled and adding the dependency as On the other hand, the if ($PSVersionTable -and ($PSVersionTable.PSVersion -ge [Version]'3.0'))
{
Write-ChocolateySuccess "$packageName already installed on your OS"
return
} So if PS v3, v4 or v5 is already preinstalled on the computer, the script will quit and the package will be marked as installed. Do you know of any better solution that would upgrade PowerShell on Windows 7 (only contains PS v2), but leave the preinstalled version of PowerShell on newer operating systems, even if they do not have the latest PS version? |
Hi MIke, No. Sorry, the way you are doing it is wrong. You are currently FORCING it to install PS v3 instead of setting that as the bottom range. Chocolatey will install PS v3 if you have a version lessor or greater than it. Let me show you: I had PowersShell v5.1 installed, and then after installing dsinternals-psmodule... my PS was forceably dowgraded. Look at the results for what Chocolatey package is installed for PowerShell: So what you really need to do is set the PowerShell dependency as the minimum or higher just like the other dependencies. Yes, if Chocolatey doesn't have a PowerShell package installed, Chocolatey is going to install the latest version, BUT if Chocolatey has a PS package v3-v5 already installed, it shouldn't do anything as the PowerShell dependency will be satisfied within the range. If you need a reference for versioning, look at: p.s. I HIGHLY recommend delisting the package right away before it downgrades more people! |
Hi Michael,
I can think of two possible resolutions here given that this is PowerShell:
|
PowerShell is one I've thought should have special handling, because some folks don't want PowerShell to upgrade unless they are intentional about it. We are looking at something similar with .NET Framework, where folks could take a dependency on a minimum version of the framework (based on an explicit package id with a version in the naming) and it would effectively noop if there is a newer .NET Framework installed. This would be used for dependencies - and then there is a .NET Framework package for folks that want an easy upgrade path. I see similar for PowerShell packages. |
Thanks for the thorough feedback, @ferventcoder and @bcurran3.
I obviously made a wrong decision and my limited tests on clean Windows machines did not point me to it, as everything got installed correctly.
Done this in release 3.5.1, which is now waiting for approval.
Yep, I did that with dotnet4.5.1 right away, but I only found powershell and powershell4 among existing packages, no powershell3. IMO, the powershell v3.0.20121027 package already does a good job by nooping on newer versions of Windows and it would deserve a re-release as powershell3. PowerShell 3 was a major milestone and many modules take it as their baseline. |
BTW, what does the following message in Chocolatey Gallery mean?
|
PS5 requires a reboot post install. The Chocolatey testing environment doesn't reboot and then continue installing packages (at least currently, looks like there might be a possibility in the future based on some recent changes). An exemption from testing is required since a requirement of PS5 being already installed can't be be a true state (currently) in the Chocolatey testing environment. |
I agree with your assessment here. |
v3.3 has a dependency on powershell (= 3.0.20121027) instead of => 3.0.20121027 and thus won't install if PowerShell 4.x or 5.x is installed.
The text was updated successfully, but these errors were encountered: