PowerShell/PowerShellGetv2

Set-PSRepository triggers installation of NUGET with user prompting

Tarjei-stavanger opened this issue · 1 comments

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Set-PSRepository psgallery -InstallationPolicy trusted;

This triggers an installation of NUGET if it is not already installed. The problem is not the installation as such, but that the user is prompted for action. Users don't know anything about what they should do and will phone IT-support and clog the system.

I find it weird that I have to install the packet manager before I have indicated that the repository is trusted.

Expected behavior

Set-PSRepository only deals with trust.

Actual behavior

Set-PSRepository installs NUGET package manager.

Error details

NA

Environment data

Enviroment is Windows Sandbox.

PS C:\Users\WDAGUtilityAccount> Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.3031
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3031
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visuals

No response

@Tarjei-stavanger we understand this frustration with the experience. We're not continuing development of PowerShellGetV2. The best solution would be to move to Microsoft.Powershell.PSResourceGet (and use the Set-PSResourceRepository cmdlet associated with that module). This issue does not exist there.

The reason it's happening here with PowerShellGet is because the module is dependent on the NuGet executable.