Get-PSrepository error

Welcome Forums General PowerShell Q&A Get-PSrepository error

Viewing 1 reply thread
  • Author
    • #182688
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member


      I am getting a Get-PSrepository error on a disconnected-environment (server with no internet access).

      I am unable to Register my local repository.

      Get-Command -Module PackageManagement | Select-Object -Property Name | Format-Wide -Column 1
      >> Find-package, Find-PackageProvider, Get-Package, Get-PackageProvider, Get-PackageSource, Import-PackageProvider, Install-Package, Install-PackageProvider, Register-PackageSource, Save-Package,Set-PackageSource,Uninstall-Package, Unregister-PackageSource

      NuGet is working at command line, returns all the commands.

      Get-PackageProvider -ListAvailable
      >> returns NuGet (only)

      Find-Module -Name PowerShellGet
      >> Returns a NuGet provider pop-up error, that NuGet must be installed in
      C:\Program Files\PackageManagement\ProviderAssemblies

      It is installed there:
      C:\Program Files\PackageManagement\ProviderAssemblies\NuGet\\Microsoft.PackageManagement.NuGetProvider.dll

      I keep going round and round???
      I would appreciate any assistance sorting this out.

    • #182754
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      When I enter Find-Module -Name n*, I get the error:

      It doesn’t find the path for NuGet.exe in:
      ($script:NuGetExePath -and (Microsoft.PowerShell.Management\Test-Path -Path $script:NuGetExePath)

      PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name ‘NuGet’. Try ‘Get-PackageProvider
      -ListAvailable’ to see if the provider exists on the system.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\\PSModule.psm1:7302 char:25
      + … $null = PackageManagement\Import-PackageProvider -Name $script:Nu …
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
      + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProvider
      Get the NuGet provider is required to continue pop-up with Yes/No/Suspend

Viewing 1 reply thread
  • The topic ‘Get-PSrepository error’ is closed to new replies.