Get-PSRepository server 2016

Welcome Forums General PowerShell Q&A Get-PSRepository server 2016

Viewing 2 reply threads
  • Author
    Posts
    • #182106
      Participant
      Topics: 2
      Replies: 3
      Points: 15
      Rank: Member

      Hello,

      On Windows Server 2016,

      Get-PSRepository

      command returns below error:

      PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).

      Running

      Get-PackageSource

      retuns this errror: Get-PackageSource : Unable to find package providers ().

      This is happening only on Windows Server 2016.

      Any ideas?

      Thank you.

    • #183198
      Moderator
      Topics: 3
      Replies: 172
      Points: 906
      Helping Hand
      Rank: Major Contributor
      
      Install-Module -Name PowerShellGet -RequiredVersion 1.6.0 -Force
      
      

      Run the above command and then check again.

      Thank you.

    • #183219
      Participant
      Topics: 2
      Replies: 3
      Points: 15
      Rank: Member

      Thank you for your suggestion Kiran.

      I'm getting now the below errors:

      PS C:\> Install-Module -Name PowerShellGet -RequiredVersion 1.6.0 -Force

      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\1.0.0.1\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.ImportPackageProv
      ider

      NuGet provider is required to continue
      PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
      provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
      'C:\Users\admcrosu\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
      running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
      and import the NuGet provider now?
      [Y] Yes [N] No Suspend [?] Help (default is "Y"): y
      PackageManagement\Install-PackageProvider : Unable to find repository with SourceLocation ". Use Get-PSRepository to
      see all available repositories.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
      + ... $null = PackageManagement\Install-PackageProvider -Name $script:N ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
      kageProvider], Exception
      + FullyQualifiedErrorId : RegisterPackageSourceRequired,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPack
      ageProvider

      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\1.0.0.1\PSModule.psm1:7411 char:21
      + ... $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
      + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv
      ider

      PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try
      'Get-PackageProvider -ListAvailable'.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7415 char:30
      + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi
      der], Exception
      + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka
      geProvider

      Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201'
      or newer version of NuGet provider is installed.
      At line:1 char:1
      + Install-Module -Name PowerShellGet -RequiredVersion 1.6.0 -Force
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException
      + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module

Viewing 2 reply threads
  • The topic ‘Get-PSRepository server 2016’ is closed to new replies.