PowerShell / PackageManagementProviderResource

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

NugetPackage resource: idempotency issue #37

Open loshurik opened 6 years ago

loshurik commented 6 years ago

I have a DSC with resources:

PackageManagementSource NugetRepository { Ensure = "Present" Name = "TrDevOpsNuget" ProviderName= "Nuget" SourceUri = "http://my.internal.nuget.repo" InstallationPolicy ="Trusted" } NugetPackage Agent { DependsOn = "[PackageManagementSource]NugetRepository" Name = MyPackage Source = "http://my.internal.nuget.repo" Ensure = "Present" DestinationPath = "C:\Temp" } It works OK for the first time and fails for next attempts. At the first run the package gets downloaded, everything works as expected. At the second run I expect to get "the state is OK, no changes needed" but NugetPackage throws this: Source 'C:\Temp\MyPackage.1.2.0.279054\MyPackage.1.2.0.279054.nupkg' is not one of the registered sources in 'NuGet' provider. Source 'C:\Temp\MyPackage.1.2.0.279054\MyPackage.1.2.0.279054.nupkg' is a file path. Package 'MyPackage.' not found in the node Ensure of MyPackage package is Absent Resource 'MyPackage' is not in the desired state. Required Ensure is 'Present' and actual Ensure is 'Absent'

Any idea?