mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
win_dsc - return warning from DSC invocation (#51927)
This commit is contained in:
@@ -307,6 +307,9 @@
|
||||
that:
|
||||
- test_dsc_custom is changed
|
||||
- test_dsc_custom_output.content|b64decode|strip_newline == test_dsc_custom_expected|strip_newline
|
||||
- test_dsc_custom.warnings | length == 2
|
||||
- "'[[xTestResource]DirectResourceAccess] test warning' in test_dsc_custom.warnings[0]"
|
||||
- "'[[xTestResource]DirectResourceAccess] set warning' in test_dsc_custom.warnings[1]"
|
||||
|
||||
- name: run custom DSC resource with version
|
||||
win_dsc:
|
||||
|
||||
@@ -119,6 +119,7 @@ CimInstanceArrayParam:
|
||||
}
|
||||
New-Item -Path $Path -ItemType File > $null
|
||||
Set-Content -Path $Path -Value $file_contents > $null
|
||||
Write-Warning -Message "set warning"
|
||||
}
|
||||
|
||||
Function Test-TargetResource
|
||||
@@ -167,6 +168,7 @@ Function Test-TargetResource
|
||||
[Microsoft.Management.Infrastructure.CimInstance[]]
|
||||
$CimInstanceArrayParam
|
||||
)
|
||||
Write-Warning -Message "test warning"
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user