Open iSnackyCracky opened 5 years ago
I've run into this before and was confused until I saw this note in the docs:
Package Management sources registered in this way are registered under the System context, usable by the System account or by the DSC engine.
I believe Package Sources and PS Repositories are per user, so perhaps you could use the PsDscRunAsCredential
parameter and it would register the source under the desired user, but I haven't tested that hypothesis.
I'm not sure, if this is the correct place, but either I don't understand DSC Resources, or the PackageManagement ones aren't coming from this Module.
I'm on a freshly installed Windows 10 Pro 1903 build 18362.30) machine and I try to setup a PackageProvider and a PackageSource with InstallationPolicy of "Trusted". The DSC Configuration looks like this:
If I now deploy this and test the configuration, everything seems to be okay:
The NuGet PackageProvider get's added correctly, even though I couldn't find any reference in the DSC-Resource files to calling anything provider-related
The PSGallery PackageSource however didn't get the IsTrusted status. (It was already registered before starting the DSC Configuration):
This seems weird after looking into the MSFT_PackageManagementSource.psm1 module. If I run the Get-TargetResource function manually, it even returns Ensure = Absent:
Am I doing something wrong? Are those functions (from the MSFT_PackageManagementSource.psm1) even used by DSC? I am just starting experimenting with DSC and a bit confused now.