File tree Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ resources:
17
17
type : Microsoft/OSInfo
18
18
properties :
19
19
family : macOS
20
+ - name : path
21
+ type : Test/Echo
22
+ properties :
23
+ output : " [envvar('PATH')]"
Original file line number Diff line number Diff line change
1
+ # The `Microsoft.Winget.DSC` resources needs to be installed: install-psresource Microsoft.Winget.DSC -Prerelease
2
+
3
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
4
+ parameters :
5
+ ensureCalc :
6
+ type : string
7
+ defaultValue : Present
8
+ allowedValues :
9
+ - Present
10
+ - Absent
11
+ resources :
12
+ - name : Use class PowerShell resources
13
+ type : Microsoft.DSC/PowerShell
14
+ properties :
15
+ resources :
16
+ - name : PowerShell 7 Preview
17
+ type : Microsoft.WinGet.DSC/WinGetPackage
18
+ properties :
19
+ Id : Microsoft.PowerShell.Preview
20
+ - name : Calc from Windows Store
21
+ type : Microsoft.WinGet.DSC/WinGetPackage
22
+ properties :
23
+ Id : " 9WZDNCRFHVN5"
24
+ Ensure : " [parameters('ensureCalc')]"
Original file line number Diff line number Diff line change
1
+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2
+ resources :
3
+ - name : WMI
4
+ type : Microsoft.Windows/WMI
5
+ properties :
6
+ resources :
7
+ - name : computer system
8
+ type : root.cimv2/Win32_ComputerSystem
9
+ - name : network adapter
10
+ type : root.cimv2/Win32_NetworkAdapter
Original file line number Diff line number Diff line change @@ -44,4 +44,14 @@ Describe 'WMI adapter resource tests' {
44
44
$res.results [0 ].result.actualState[1 ].BiosCharacteristics | Should -Not - BeNull
45
45
$res.results [0 ].result.actualState[2 ].NumberOfLogicalProcessors | Should -Not - BeNull
46
46
}
47
+
48
+ It ' Example config works' - Skip:(! $IsWindows ) {
49
+ $configPath = Join-Path $PSScriptRoot ' ..\..\dsc\examples\wmi.dsc.yaml'
50
+ $r = dsc config get - p $configPath
51
+ $LASTEXITCODE | Should - Be 0
52
+ $r | Should -Not - BeNullOrEmpty
53
+ $res = $r | ConvertFrom-Json
54
+ $res.results [0 ].result.actualState[0 ].Model | Should -Not - BeNullOrEmpty
55
+ $res.results [0 ].result.actualState[1 ].Description | Should -Not - BeNullOrEmpty
56
+ }
47
57
}
Original file line number Diff line number Diff line change 1
1
wmi.resource.ps1
2
- wmi.dsc.resource.json.optout
2
+ wmi.dsc.resource.json
You can’t perform that action at this time.
0 commit comments