File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
powershell-adapter/psDscAdapter Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ function Invoke-DscOperation {
373
373
374
374
# using the cmdlet the appropriate dsc module, and handle errors
375
375
try {
376
- Write-DscTrace - Operation Debug - Message " Module: $ ( $cachedDscResourceInfo.ModuleName ) , Name: $ ( $cachedDscResourceInfo.Name ) , Property: $ ( $property ) "
376
+ Write-DscTrace - Operation Debug - Message " Module: $ ( $cachedDscResourceInfo.ModuleName ) , Name: $ ( $cachedDscResourceInfo.Name ) , Property: `n $ ( $property | Out-String ) "
377
377
$invokeResult = Invoke-DscResource - Method $Operation - ModuleName $cachedDscResourceInfo.ModuleName - Name $cachedDscResourceInfo.Name - Property $property - ErrorAction Stop
378
378
379
379
if ($invokeResult.GetType ().Name -eq ' Hashtable' ) {
@@ -389,6 +389,9 @@ function Invoke-DscOperation {
389
389
}
390
390
catch {
391
391
$_.Exception | Format-List * - Force | Out-String | Write-DscTrace - Operation Debug
392
+ if ($_.Exception.MessageId -eq ' DscResourceNotFound' ) {
393
+ Write-DscTrace - Operation Warn - Message ' For Windows PowerShell, DSC resources must be installed with scope AllUsers'
394
+ }
392
395
' Exception: ' + $_.Exception.Message | Write-DscTrace - Operation Error
393
396
exit 1
394
397
}
@@ -427,7 +430,10 @@ function Invoke-DscOperation {
427
430
}
428
431
}
429
432
catch {
430
-
433
+ $_.Exception | Format-List * - Force | Out-String | Write-DscTrace - Operation Debug
434
+ if ($_.Exception.MessageId -eq ' DscResourceNotFound' ) {
435
+ Write-DscTrace - Operation Warn - Message ' For Windows PowerShell, DSC resources must be installed with scope AllUsers'
436
+ }
431
437
' Exception: ' + $_.Exception.Message | Write-DscTrace - Operation Error
432
438
exit 1
433
439
}
You can’t perform that action at this time.
0 commit comments