-
Notifications
You must be signed in to change notification settings - Fork 35
PowerShell DSC resource is not registered as a WMI DSC resource #698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @m-mrks, what is the module's installed location? If it is in your user profile, can you move the module to: |
Thanks, that worked. However, the original location was not in a user profile, but in PS C:\> Get-Module -Name 'ComputerManagementDsc' -ListAvailable
Directory: C:\Program Files\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 10.0.0 ComputerManagementDsc Desk
PS C:\> $env:PSModulePath -split ';'
C:\Users\Administrator\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\7\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules After moving the module to PS C:\> Get-Module -Name 'ComputerManagementDsc' -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 10.0.0 ComputerManagementDsc Desk
PS C:\> dsc resource test --resource ComputerManagementDsc/TimeZone --file C:\Users\Administrator\Desktop\test_timezone.json
desiredState:
IsSingleInstance: Yes
TimeZone: W. Europe Standard Time
adapted_dsc_type: ComputerManagementDsc/TimeZone
actualState:
result:
- name: Microsoft.Windows/WindowsPowerShell
type: ComputerManagementDsc/TimeZone
properties:
InDesiredState: false
inDesiredState: false
differingProperties:
- IsSingleInstance
- TimeZone
- adapted_dsc_type |
Yes correct, that's the PowerShell 7 folder. As you're using the WindowsPowerShell adapter, it should be in that folder you've mentioned :). I don't think this is a limitation of |
Thanks again for the additional clarification. Somewhat unrelated, but are there any recommendations on deploying DSC modules? Until now we've used
So, is a |
More of a personal opinion, I would move away from using |
Prerequisites
Summary
Hi all,
My apologies for raising an issue on this, I couldn't find any usefull guidance on an empty getting started page, so I have to trial-and-error.
Goal is to migrate from PSDSC to DSC3.
As a first test, I want to set a different timezone, and that fails using DSC 3.0.0 with PowerShell 7.5 on Windows Server 2022 using ComputerManagementDsc 10.0.0.
Message in the trace reads:
As far as I know the ComputerManagementDsc resource uses CIM instead of WMI.
I'm puzzled; how to set the timezone using DSC3?
Steps to reproduce
The
test_timezone.json
file:And the resource:
Expected behavior
A working test for
`dsc resource test --resource ComputerManagementDsc/TimeZone --file C:\Users\Administrator\Desktop\test_timezone.json`
Actual behavior
Error details
Environment data
Version
3.0.0
Visuals
No response
The text was updated successfully, but these errors were encountered: