PowerShell / DSC

This repo is for the DSC v3 project
MIT License
142 stars 22 forks source link

Microsoft.Windows/Registry fails to open key in alpha 4 release #283

Closed msftrubengu closed 3 months ago

msftrubengu commented 8 months ago

Prerequisites

Steps to reproduce

Download v3.0.0-alpha.4 x86_64 windows. Use Microsoft.Windows/Registry or config file with the resource

Using the resources built from v3.0.0-alpha.4 works, so I'm assuming this is an issue with the binaries in the release.

Expected behavior

PS D:\Dev\DSC> dsc --input-file d:\dev\DscV3\configFiles\resources.yml config test
  2023-11-21T19:53:27.008710Z  INFO dsc: Reading input from file d:\dev\DscV3\configFiles\resources.yml
    at src\main.rs:53

  2023-11-21T19:53:29.617538Z  INFO dsc_lib::dscresources::command_resource: Invoking test Microsoft.Windows/Registry using registry
    at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:232

  2023-11-21T19:53:29.662573Z  INFO dsc_lib::dscresources::command_resource: Invoking test Microsoft.Windows/Registry using registry
    at D:\Dev\DSC\dsc_lib\src\dscresources\command_resource.rs:232

results:
- name: test 1
  type: Microsoft.Windows/Registry
  result:
    desiredState:
      keyPath: HKCU\DscTest
      _exist: true
    actualState:
      $id: https://developer.microsoft.com/json-schemas/windows/registry/20230303/Microsoft.Windows.Registry.schema.json      keyPath: HKCU\DscTest
      _exist: false
      _inDesiredState: false
    inDesiredState: false
    differingProperties:
    - _exist
- name: test 2
  type: Microsoft.Windows/Registry
  result:
    desiredState:
      keyPath: HKCU\DscTest2
      _exist: true
    actualState:
      $id: https://developer.microsoft.com/json-schemas/windows/registry/20230303/Microsoft.Windows.Registry.schema.json      keyPath: HKCU\DscTest2
      _exist: false
      _inDesiredState: false
    inDesiredState: false
    differingProperties:
    - _exist
messages: []
hadErrors: false

Actual behavior

D:\Dev>dsc --input-file DscV3\configFiles\resources.yml config test
  2023-11-21T18:47:20.393816Z  INFO dsc: Reading input from file DscV3\configFiles\resources.yml
    at src\main.rs:53

  2023-11-21T18:47:23.021388Z  INFO dsc_lib::dscresources::command_resource: Invoking test Microsoft.Windows/Registry using registry
    at D:\a\_work\1\s\DSC\dsc_lib\src\dscresources\command_resource.rs:232

  2023-11-21T18:47:23.037080Z ERROR dsc::subcommand: Error: Command: Resource 'Microsoft.Windows/Registry' [Exit code 3] Error testing config: Unknown error: 0xc0000005: Failed to open key '\Registry\User\S-1-12-1-3193586617-1244601399-2030842547-3990457818\DscTest'.

    at src\subcommand.rs:84

Error details

ERROR dsc::subcommand: Error: Command: Resource 'Microsoft.Windows/Registry' [Exit code 3] Error testing config: Unknown error: 0xc0000005: Failed to open key '\Registry\User\S-1-12-1-3193586617-1244601399-2030842547-3990457818\DscTest'.

Environment data

v3.0.0-alpha.4 x86_64 windows

Version

v3.0.0-alpha.4 x86_64 windows

Visuals

No response

SteveL-MSFT commented 7 months ago

I wonder if this is because of the mark-of-the-web. @msftrubengu can you run via PowerShell: get-childitem | unblock-file within the zip contents and try again?