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'
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?