Choco: upgrade: Add a switch to disable pin when upgrade

Created on 16 May 2020  路  2Comments  路  Source: chocolatey/choco

Motivation

I've pinned powershell-core because you mess up if you upgrade PowerShell Core in PowerShell Core.
So when I have to upgrade PowerShell Core, I have to remove pin and upgrade and add pin again.
Specifically, I follow this procedure:

  1. choco upgrade all in PowerShell Core
  2. Checks Powershell Core has an upgrade (with this package is pinned warning message)
  3. Go to safer terminal (such as PowerShell 5.1)
  4. choco pin remove -n=powershell-core in Powershell
  5. choco upgrade powershell-core in Powershell
  6. choco pin add -n=powershell-core in Powershell

The point is someone uses pin for delay upgrades, not to block upgrades forever.

Solution

Add a switch --disable-pin to upgrade.
When this switch is enabled, pinned packages will be upgraded.
choco upgrade powershell-core --disable-pin has same effect with the above procedure 4-6.

Other suggestions

Switch name could be

  • --ignore-pin
  • --exclude-pin
  • --disable-pin-once
0 - _Triaging Enhancement Up For Grabs

Most helpful comment

Hear, Hear!
I could not agree more.
I asked this exact question on StackExchange Super User.

At the least, it would be nice if the documentation for pinning explicitly stated that there is no way to temporarily bypass the pin. One can only manually remove the pin, upgrade and repin.

Notwithstanding my asking for more, Chocolatey is really good. Thank you.

All 2 comments

I think this may already be an issue? Or at least something related like install with pin.

Hear, Hear!
I could not agree more.
I asked this exact question on StackExchange Super User.

At the least, it would be nice if the documentation for pinning explicitly stated that there is no way to temporarily bypass the pin. One can only manually remove the pin, upgrade and repin.

Notwithstanding my asking for more, Chocolatey is really good. Thank you.

Was this page helpful?
0 / 5 - 0 ratings