Skip to content

Commit a990aac

Browse files
committed
Include get test and removal
1 parent a4019ca commit a990aac

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

powershell-adapter/Tests/win_powershellgroup.tests.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Describe 'WindowsPowerShell adapter resource tests - requires elevated permissio
2020

2121
# Remove after all the tests are done
2222
Remove-Module $script:winPSModule -Force -ErrorAction Ignore
23+
24+
Remove-Item -Path (Join-Path $env:SystemRoot 'System32' 'WindowsPowerShell' 'v1.0' 'Modules' 'PSClassResource') -Force -Recurse -ErrorAction Ignore
2325
}
2426

2527
BeforeEach {
@@ -331,6 +333,13 @@ class PSClassResource {
331333
}
332334

333335
$resources = dsc -l trace resource list --adapter Microsoft.Windows/WindowsPowerShell | ConvertFrom-Json
336+
$LASTEXITCODE | Should -Be 0
334337
$resources.type | Should -Contain 'PSClassResource/PSClassResource'
335338
}
336-
}
339+
340+
It 'Get works with class-based DSC resources' -Skip:(!$IsWindows) {
341+
342+
$out = dsc resource get -r PSClassResource/PSClassResource --input (@{Name = 'TestName'} | ConvertTo-Json) | ConvertFrom-Json
343+
$LASTEXITCODE | Should -Be 0
344+
$out.actualState.Name | Should -Be 'TestName'
345+
}

0 commit comments

Comments
 (0)