File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -125,4 +125,24 @@ Describe 'registry config set tests' {
125125
126126 Get-ItemProperty - Path ' HKCU:\1\2' - Name ' Test' - ErrorAction Ignore | Should - BeNullOrEmpty
127127 }
128+
129+ It ' Should succeed when _exist is false and key does not exist' - Skip:(! $IsWindows ) {
130+ $config = @ {
131+ ' $schema' = ' https://aka.ms/dsc/schemas/v3/bundled/config/document.json'
132+ resources = @ (
133+ @ {
134+ name = ' reg'
135+ type = ' Microsoft.Windows/Registry'
136+ properties = @ {
137+ keyPath = ' HKCU\1'
138+ _exist = $false
139+ }
140+ }
141+ )
142+ }
143+
144+ $out = dsc config set - i ($config | ConvertTo-Json - Depth 10 ) | ConvertFrom-Json
145+ $LASTEXITCODE | Should - Be 0
146+ $out.results [0 ].result.afterState._exist | Should - Be $false
147+ }
128148}
You can’t perform that action at this time.
0 commit comments