Skip to content
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

WMI resource provider #279

Merged
merged 6 commits into from
Nov 28, 2023
Merged

WMI resource provider #279

merged 6 commits into from
Nov 28, 2023

Conversation

anmenaga
Copy link
Collaborator

PR Summary

Fix #263

Prototype of a resource provider to read data from WMI.

PR Context

Supported operations: dsc resource list, dsc resource get, dsc config get. Export will be easy to add once #183 is closed.
This resource provider uses Windows PowerShell and CimCmdlets PS module. Initially tried using WMI-rs crate, but it didn't work out because looks like it does not return some required class metadata.

Example:

PS C:\DSCv3> dsc resource list *BIOS
Type                         Version  Requires      Description
---------------------------------------------------------------
root\cimv2/Win32_BIOS                 DSC/WMIGroup
root\cimv2/Win32_SystemBIOS           DSC/WMIGroup

PS C:\DSCv3> dsc resource get -r root\cimv2/Win32_BIOS
actualState:
  EmbeddedControllerMinorVersion: 255
  BuildNumber: null
  Description: 1.22.0
  ReleaseDate: /Date(1678924800000)/
  Manufacturer: Dell Inc.
  SoftwareElementID: 1.22.0
...

wmigroup/Tests/test_wmi_config.dsc.yaml Outdated Show resolved Hide resolved
wmigroup/copy_files.txt Show resolved Hide resolved
wmigroup/Tests/test_wmi_config.dsc.yaml Show resolved Hide resolved
wmigroup/wmigroup.resource.ps1 Outdated Show resolved Hide resolved
Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for a prototype until we get more feedback

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Nov 28, 2023
Merged via the queue into PowerShell:main with commit 52329a5 Nov 28, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WMIGroupResource
3 participants