You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powershell-adapter/psDscAdapter/psDscAdapter.psm1
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -384,7 +384,7 @@ function Get-DscResourceObject {
384
384
385
385
# catch potential for improperly formatted configuration input
386
386
if ($inputObj.resources-and-not$inputObj.metadata.'Microsoft.DSC'.context -eq'configuration') {
387
-
'WARNING: The input has a top level property named "resources" but is not a configuration. If the input should be a configuration, include the property: "metadata": {"Microsoft.DSC": {"context": "Configuration"}}'|Write-DscTrace
387
+
'The input has a top level property named "resources" but is not a configuration. If the input should be a configuration, include the property: "metadata": {"Microsoft.DSC": {"context": "Configuration"}}'|Write-DscTrace-Operation Warn
388
388
}
389
389
390
390
$adapterName='Microsoft.DSC/PowerShell'
@@ -486,12 +486,12 @@ function Invoke-DscOperation {
'Resource ImplementationDetail not supported: '+$cachedDscResourceInfo.ImplementationDetail|Write-DscTrace
494
+
'Resource ImplementationDetail not supported: '+$cachedDscResourceInfo.ImplementationDetail|Write-DscTrace-Operation Error
495
495
exit1
496
496
}
497
497
}
@@ -500,8 +500,7 @@ function Invoke-DscOperation {
500
500
}
501
501
else {
502
502
$dsJSON=$DesiredState|ConvertTo-Json-Depth 10
503
-
$errmsg='Can not find type "'+$DesiredState.type+'" for resource "'+$dsJSON+'". Please ensure that Get-DscResource returns this resource type.'
504
-
'ERROR: '+$errmsg|Write-DscTrace
503
+
'Can not find type "'+$DesiredState.type+'" for resource "'+$dsJSON+'". Please ensure that Get-DscResource returns this resource type.'|Write-DscTrace-Operation Error
if (-not [string]::IsNullOrEmpty($importModuleError)) {
31
-
'ERROR: Could not import PSDesiredStateConfiguration 1.1 in Windows PowerShell. '+$importModuleError|Write-DscTrace
31
+
'Could not import PSDesiredStateConfiguration 1.1 in Windows PowerShell. '+$importModuleError|Write-DscTrace-Operation Error
32
32
}
33
33
}
34
34
@@ -173,7 +173,7 @@ function Invoke-DscCacheRefresh {
173
173
if ( $psdscVersion-ge'2.0.7' ) {
174
174
# only support known dscResourceType
175
175
if ([dscResourceType].GetEnumNames() -notcontains$dscResource.ImplementationDetail) {
176
-
'WARNING: implementation detail not found: '+$dscResource.ImplementationDetail|Write-DscTrace
176
+
'Implementation detail not found: '+$dscResource.ImplementationDetail|Write-DscTrace-Operation Warn
177
177
continue
178
178
}
179
179
}
@@ -261,7 +261,7 @@ function Get-DscResourceObject {
261
261
262
262
# catch potential for improperly formatted configuration input
263
263
if ($inputObj.resources-and-not$inputObj.metadata.'Microsoft.DSC'.context -eq'configuration') {
264
-
'WARNING: The input has a top level property named "resources" but is not a configuration. If the input should be a configuration, include the property: "metadata": {"Microsoft.DSC": {"context": "Configuration"}}'|Write-DscTrace
264
+
'The input has a top level property named "resources" but is not a configuration. If the input should be a configuration, include the property: "metadata": {"Microsoft.DSC": {"context": "Configuration"}}'|Write-DscTrace-Operation Warn
265
265
}
266
266
267
267
# match adapter to version of powershell
@@ -338,7 +338,7 @@ function Invoke-DscOperation {
338
338
339
339
# For Linux/MacOS, only class based resources are supported and are called directly.
340
340
if ($IsLinux) {
341
-
'ERROR: Script based resources are only supported on Windows.'|Write-DscTrace
341
+
'Script based resources are only supported on Windows.'|Write-DscTrace-Operation Error
342
342
exit1
343
343
}
344
344
@@ -374,7 +374,7 @@ function Invoke-DscOperation {
@@ -459,8 +459,7 @@ function Invoke-DscOperation {
459
459
}
460
460
else {
461
461
$dsJSON=$DesiredState|ConvertTo-Json-Depth 10
462
-
$errmsg='Can not find type "'+$DesiredState.type+'" for resource "'+$dsJSON+'". Please ensure that Get-DscResource returns this resource type.'
463
-
'ERROR: '+$errmsg|Write-DscTrace
462
+
'Can not find type "'+$DesiredState.type+'" for resource "'+$dsJSON+'". Please ensure that Get-DscResource returns this resource type.'|Write-DscTrace-Operation Error
0 commit comments