You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
Details of the scenario you tried and the problem that is occurring
Trying to remove a registry value. I had been successfully creating Registry resources specifying the Keys in the "HKEY_LOCAL_MACHINE\*" format. However, when I switched to Ensure = 'Absent', it failed.
Verbose logs showing the problem
PowerShell DSC resource MSFT_RegistryResource failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Windows\system32\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run' because it does not exist. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : localhost
Suggested solution to the issue
Account for specifying keys in the HKEY_LOCAL_MACHINE format (which works for 'Present') in the code at:
Just ran into this, because I inadvertently had imported PSDscResources.
Not importing PSDscResources makes it work, as it then falls back to PSDesiredStateConfiguration.
It also works just writing 'HKLM:\Software...' instead of HKEY_LOCAL_MACHINE, so it utilizes the PSDrive for Cert:
Incase anyone else stumples upon this down the road.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Details of the scenario you tried and the problem that is occurring
Trying to remove a registry value. I had been successfully creating Registry resources specifying the Keys in the "HKEY_LOCAL_MACHINE\*" format. However, when I switched to Ensure = 'Absent', it failed.
Verbose logs showing the problem
PowerShell DSC resource MSFT_RegistryResource failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Windows\system32\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run' because it does not exist. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : localhost
Suggested solution to the issue
Account for specifying keys in the HKEY_LOCAL_MACHINE format (which works for 'Present') in the code at:
PSDscResources/DscResources/MSFT_RegistryResource/MSFT_RegistryResource.psm1
Lines 309 to 313 in 7064eda
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows 10 Enterprise for Virtual Desktops
OsOperatingSystemSKU : 175
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.19041.1023
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1023
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
2.12.0.0
The text was updated successfully, but these errors were encountered: