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
{{ message }}
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
Hi
Please help me to understand the intended behavior for -Force and -Confirm!
My Usecase: "Install-PackageProvider"
Requirements:
ensure a certain minimumversion of a provider (-MinimumVersion)
no confirmation dialog needed (assuming answer YES) (-Confirmation:$false)
not for trust in download source
not for overriding existing version
No Download/install needed if just installed (-Force:$false)
do all of that with one commandlet (Usability/nice to have)
Sample
on my machine the Version 2.8.5.127 of the Nuget Packageprovider is installed.
my script should "ensure" that Version 2.8.5.201 (-Minimumversion) is installed
result: PS-ISE shows a Confirmation Dialog for a not trusted Repository (https://oneget.org)
After a click on OK it installs the Packageprovider => OK and expected behavior
My next challange: how suppress that Confirmation Warning ?
proposed solution by Powershell (general)
use "-Confirmation:$false"
BUT: this does not helps!
It seems that "Install-PackageProvider" ignores the -Confirmation Settings for that security question!
Workaround: with the -Force Switch i'm able to work around this problem... the Confirmation-Dialog does NOT shows up.
My question about this:
In my understanding the "-Force" switch has another meaning
it should solve/override questions about versioning/overriding installed versions.
But here the -Force switch is used for 2 different purposes => conflict.
purpose 1: security/trust on download sources
purpose 2: install-behavior (override or not)
Is this a bug in the Install-PackageProvider Cmdlet?
(some other PowerShellGet cmdlet seems to have the same behavior)