Closed headcra6 closed 2 years ago
Hi @headcra6 , what happens when you import the module as the error message states? If that doesn't work, you can try to install the modules again, but then in the device context. Install-Module Microsoft365DSC -Force. After that you can try again.
Unfortunately, it doesn't help. The command Install-Module Microsoft365DSC -Force installed everything in my profile it is the default behavior I used Install-Module Microsoft365DSC -Force -Scope AllUsers. It installs in PS7 Modules since I'm using it in development.. And the curious thing here it fails. I find a workaround finally but it looks like some hardcodes are in place. What have I done:
It really depends on how environment variables are configured. It shouldn't matter if you are using PS5 or PS7, when running:
Get-Module Microsoft365DSC -ListAvailable
You should only ever get one entry back.
Hi! It must have something to do with the localhost node when running Start-DSCConfig, no?
I realized it runs PS5.1 in localhost, even if you execute the cmdlet in PS7.
Hi, I'm working on a new resource implementation and facing an issue with final tests of how the exported resource can be applied with use of Start-DscConfiguration My initial setup:
What was observed: Issue#1 Once started failed with
InvalidOperation: The PowerShell DSC resource MSFT_<ResourceName> from module <Microsoft365DSC,1.21.1110.1> does not exist at the PowerShell module path nor is it registered as a WMI DSC resource.
It was partially solved but in not that obvious way. I Installed the module here "%ProgramFiles%\WindowsPowerShell\Modules\" and copied my resource here. The issue with "resource not found" disappeared, but other issues appeared. However, it worth mentioning that even if I start this cmdlet from PS7 console it detects resource only if it located in per-machine PS 5 module path. Looks like it was hardcoded somehow Issue#2 After resource was detected the following errors appeared:Direct call of mentioned cmdlets works, at least asking for params
Could you please advise on above?
Thanks