PowerShell / PackageManagementProviderResource

Modules with DSC resources for the PackageManagement(aka OneGet) providers.
MIT License
37 stars 24 forks source link

Unable to find package providers (PSModule) on first run #13

Closed rdean716 closed 8 years ago

rdean716 commented 8 years ago

While installing modules from an internal repository using the PSModule resource the below errors are generated for each required module during the set function. However, after trying to connect to the PowerShell Gallery 3 times, the module is eventually download from the internal gallery.

Unable to find package providers (PSModule).
           + CategoryInfo          : InvalidArgument: (Microsoft.Power...etPackageSou
          rce:) [], CimException
           + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageMan
          agement.Cmdlets.GetPackageSource
           + PSComputerName        : localhost

       The PowerShell DSC resource '[PSModule]Tooling' with SourceInfo
       '::110::9::PSModule' threw one or more non-terminating errors while running
       the Set-TargetResource functionality. These errors are logged to the ETW
       channel called Microsoft-Windows-DSC/Operational. Refer to this channel for
       more details.
           + CategoryInfo          : InvalidOperation: (:) [], CimException
           + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
           + PSComputerName        : localhost

The configuration that produces this error:

        PackageManagementSource SourceRepository
        {
            Ensure = "Present"
            Name = "InternalNuget"
            ProviderName = "PowerShellGet"
            SourceUri = "https://internalgallery/service/local/nuget/nuget-releases/"
            InstallationPolicy = "Trusted"

        }

        PSModule Tooling
        {
            Ensure = "Present"
            Name = "tooling"
            RequiredVersion = "1.0.0.27"
            Repository = "InternalNuget"
            InstallationPolicy = "Trusted"
        }
gaelcolas commented 8 years ago

I get similar non-terminating errors, and even using the PSGallery: Unable to find package providers (PSModule).

I saw another dsc resource (PowerShell.Org NuGet) having similar error, so I guess the underlying issue could be with PowerShell Package Management module?

Krishna-Vutukuri commented 8 years ago

This issue should be fixed now. Please try out the latest build from the master branch or download from gallery: https://www.powershellgallery.com/packages/PackageManagementProviderResource/1.0.3