File tree Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,8 @@ Describe 'dsc config get tests' {
26
26
27
27
It ' will fail if resource schema does not match' - Skip:(! $IsWindows ) {
28
28
$jsonPath = Join-Path $PSScriptRoot ' ../examples/invalid_schema.dsc.yaml'
29
- $config = Get-Content $jsonPath - Raw
30
- $testError = & {$config | dsc config get -f - 2>&1 }
31
- $testError [0 ] | Should -match ' error:'
29
+ $testError = & {dsc config get -f $jsonPath 2>&1 }
30
+ $testError [0 ] | Should -match ' Schema:'
32
31
$LASTEXITCODE | Should - Be 2
33
32
}
34
33
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ Describe 'whatif tests' {
35
35
properties:
36
36
keyPath: 'HKCU\1\2'
37
37
"@
38
- $what_if_result = $config_yaml | dsc config set - w -f - | ConvertFrom-Json
39
- $set_result = $config_yaml | dsc config set | ConvertFrom-Json
38
+ $what_if_result = dsc config set - w - i $config_yaml | ConvertFrom-Json
39
+ $set_result = dsc config set - i $config_yaml | ConvertFrom-Json
40
40
$what_if_result.metadata .' Microsoft.DSC' .executionType | Should - BeExactly ' WhatIf'
41
41
$what_if_result.results.result.beforeState._exist | Should - Be $set_result.results.result.beforeState._exist
42
42
$what_if_result.results.result.beforeState.keyPath | Should - Be $set_result.results.result.beforeState.keyPath
Original file line number Diff line number Diff line change 1
1
# Copyright (c) Microsoft Corporation.
2
2
# Licensed under the MIT License.
3
3
4
- Describe ' WindowsPowerShell adapter resource tests' {
4
+ Describe ' WindowsPowerShell adapter resource tests - requires elevated permissions ' {
5
5
6
6
BeforeAll {
7
7
if ($isWindows ) {
@@ -63,12 +63,12 @@ Describe 'WindowsPowerShell adapter resource tests' {
63
63
64
64
It ' Get works on config with File resource for WinPS' - Skip:(! $IsWindows ){
65
65
66
- $testFile = " $testdrive \test.txt"
67
- ' test' | Set-Content - Path $testFile - Force
68
- $r = (Get-Content - Raw $winpsConfigPath ).Replace(' c:\test.txt' , " $testFile " ) | dsc config get -f -
69
- $LASTEXITCODE | Should - Be 0
70
- $res = $r | ConvertFrom-Json
71
- $res.results [0 ].result.actualState.result[0 ].properties.DestinationPath | Should - Be " $testFile "
66
+ $testFile = " $testdrive \test.txt"
67
+ ' test' | Set-Content - Path $testFile - Force
68
+ $r = (Get-Content - Raw $winpsConfigPath ).Replace(' c:\test.txt' , " $testFile " ) | dsc config get -f -
69
+ $LASTEXITCODE | Should - Be 0
70
+ $res = $r | ConvertFrom-Json
71
+ $res.results [0 ].result.actualState.result[0 ].properties.DestinationPath | Should - Be " $testFile "
72
72
}
73
73
74
74
It ' Verify that there are no cache rebuilds for several sequential executions' - Skip:(! $IsWindows ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ Describe 'WMI adapter resource tests' {
48
48
49
49
It ' Example config works' - Skip:(! $IsWindows ) {
50
50
$configPath = Join-Path $PSScriptRoot ' ..\..\configurations\windows\windows_inventory.dsc.yaml'
51
- $r = dsc config get - p $configPath
51
+ $r = dsc config get -f $configPath
52
52
$LASTEXITCODE | Should - Be 0
53
53
$r | Should -Not - BeNullOrEmpty
54
54
$res = $r | ConvertFrom-Json
You can’t perform that action at this time.
0 commit comments