diff --git a/powershellgroup/powershellgroup.dsc.resource.json b/powershellgroup/powershellgroup.dsc.resource.json index e561018d..7896ec74 100644 --- a/powershellgroup/powershellgroup.dsc.resource.json +++ b/powershellgroup/powershellgroup.dsc.resource.json @@ -55,6 +55,16 @@ "input": "stdin", "return": "state" }, + "validate": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "$Input | ./powershellgroup.resource.ps1 Validate" + ] + }, "exitCodes": { "0": "Success", "1": "Error" diff --git a/powershellgroup/powershellgroup.resource.ps1 b/powershellgroup/powershellgroup.resource.ps1 index dbf3d972..4a8b5763 100644 --- a/powershellgroup/powershellgroup.resource.ps1 +++ b/powershellgroup/powershellgroup.resource.ps1 @@ -3,7 +3,7 @@ [CmdletBinding()] param( - [ValidateSet('List','Get','Set','Test')] + [ValidateSet('List','Get','Set','Test','Validate')] $Operation = 'List', [Switch] $WinPS = $false, @@ -327,6 +327,11 @@ elseif ($Operation -eq 'Test') $result | ConvertTo-Json } +elseif ($Operation -eq 'Validate') +{ + # TODO: this is placeholder + @{ valid = $true } | ConvertTo-Json +} else { "ERROR: Unsupported operation requested from powershellgroup.resource.ps1"