No match was found for provider Nuget on initial installation attempt
ruffin-- opened this issue · 1 comments
Goal
Attempting to follow installation instructions from here:
Note: For PowerShell version
5.1.14393.206or newer, before installing PSScriptAnalyzer, please install the latest Nuget provider by running the following in an elevated PowerShell session.Install-PackageProvider Nuget -MinimumVersion 2.8.5.201 –Force Exit
Steps to reproduce
- Hit Windows Key.
- Type
pwsh - Mouse to right and select "Run as adminstrator"
- Select "Yes" for User Access Control
- Paste commands from instructions.
PowerShell 7.2.0
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS C:\Windows\System32> Install-PackageProvider Nuget -MinimumVersion 2.8.5.201 –Force
Install-PackageProvider: No match was found for the specified search criteria for the provider 'Nuget'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
PS C:\Windows\System32>Expected behavior
Nuget is installed successfully.
Actual behavior
Error as shown above and repeated here:
Install-PackageProvider: No match was found for the specified search criteria for the provider 'Nuget'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.If an unexpected error was thrown then please report the full error details using e.g.
$error[0] | Select-Object *
PS C:\Windows\System32> $error[0] | Select-Object *
PSMessageDetails :
Exception : System.Exception: No match was found for the specified search criteria for the provider
'Nuget'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check
if the specified package has the tags.
TargetObject : Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider
CategoryInfo : InvalidArgument: (Microsoft.PowerShel…tallPackageProvider:InstallPackageProvider)
[Install-PackageProvider], Exception
FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}Environment data
PS C:\Windows\System32> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.0
PSEdition Core
GitCommitId 7.2.0
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0(Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
PS C:\Windows\System32> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
InvalidOperation: You cannot call a method on a null-valued expression.Hi @ruffin-- can you try manually installing PackageManagement and PowerShellGet following these steps outlined here: https://github.com/PowerShell/PowerShellGet/issues/488#issuecomment-926102857
We will be investigating further in hope to have a more clarified fix of instructions.