Open mhendric opened 5 years ago
@mhendric The documentation about compiling resources for Azure Automation DSC states the following
When compilation is complete you may receive an error stating: The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported. This warning can safely be ignored.
https://docs.microsoft.com/en-us/azure/automation/automation-dsc-compile#assets
If you do ask Google about this you'll find numerous places where this issue is mentioned and as far as I can tell (also by taking into account the stuff that I found via Google) the warning will be issued when you compile a DSC configuration. My guess is confirmed by the fact that after such a warning you'll always find a Pester statement about Should compile
blahblah. Interesting is that this warning does not appear if you compile a DSC configuration interactively in a PowerShell session, what you already mentioned.
So I think to have this (really annoying!!!) warning fixed you must get in touch with the people who maintain the DSC core infrastructure. I think @kwirkykat @johlju or @PlagueHO can help here.
Details of the scenario you tried and the problem that is occurring
The Integration test logs are full of the below Warning messages. In the most recent Integration test job, there were 189 instances of this. This does not occur in the Unit tests however. This also does not occur when I run the Integration tests on my own Windows 2019 machine.
The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
Verbose logs showing the problem
A bigger example from https://ci.appveyor.com/project/PowerShell/xpsdesiredstateconfiguration/builds/23613517/job/7ec82b42naour8iy:
Suggested solution to the issue
I'm unsure of how to fix this. Would appreciate community assistance.
Version of the DSC module that was used ('dev' if using current dev branch)
dev