Thứ Năm, 21 tháng 10, 2021

Install-Package : No match was found for the specified search criteria and module name

 PS C:\Users\Administrator> Install-Module -Name PSFolderSize

PackageManagement\Install-Package : No match was found for the specified search criteria and module name

'PSFolderSize'. Try Get-PSRepository to see all available registered module repositories.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21

+ ...          $null = PackageManagement\Install-Package @PSBoundParameters

+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex

   ception

    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Simply running Register-PSRepository -Default (without any additional parameters) worked for me. After that, the Gallery was successfully registered:

PS C:\Users\Administrator> Register-PSRepository -Default
PS C:\Users\Administrator> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2


PS C:\Users\Administrator> Install-Module -Name PSFolderSize

Share This!


Không có nhận xét nào:

Đăng nhận xét