Open sperry opened 9 months ago
I was testing on a newer version of WinGet, and I'm getting a different error.
properties:
resources:
- resource: PSDscResources/Registry
directives:
description: Add Key
settings:
Key: 'HKLM:\SOFTWARE\XYZ'
Ensure: Present
ValueName: MyValue
ValueType: String
ValueData: MyData
Force: '$True'
configurationVersion: 0.2.0
winget configure registry.dsc.yaml
Apply :: Registry
Add Key
Module: PSDscResources by Microsoft Corporation [Local]
https://github.com/PowerShell/PSDscResources
This module contains the standard DSC resources.
Because PSDscResources overwrites in-box resources, it is only available for WMF 5.1. Many of the resource updates provided here are also included in the xPSDesiredStateConfiguration module which is still compatible with WMF 4 and WMF 5 (though that module is not supported and may be removed in the future).
Settings:
Force: $True
ValueName: MyValue
Ensure: Present
ValueData: MyData
Key: HKLM:\SOFTWARE\XYZ
ValueType: String
You are responsible for understanding the configuration settings you are choosing to execute. Microsoft is not responsible for the configuration file you have authored or imported. This configuration may change settings in Windows, install software, change software settings (including security settings), and accept user agreements to third-party packages and services on your behalf. By running this configuration file, you acknowledge that you understand and agree to these resources and settings. Any applications installed are licensed to you by their owners. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages or services.
Have you reviewed the configuration and would you like to proceed applying it to the system?
[Y] Yes [N] No: Y
Apply :: Registry
The configuration unit failed while attempting to test the current system state.
Cannot process argument transformation on parameter 'Force'. Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.
<See the log file for additional details>
Some of the configuration was not applied successfully.
Brief description of your issue
Running from an administrator "cmd" prompt I am trying to use "winget configure" to apply the following:
I get
It's only an issue creating Key directly under SOFTWARE. Again I am running from Administrator shell. Is Winget running as some other user
Steps to reproduce
Expected behavior
Registry key should be created as expected since I'm Administrator
Actual behavior
Registry key not created and error says "Requested registry access is not allowed"
Environment