Update Write-CMTraceLog.ps1

pull/597/head
Andrzej Demski 2024-04-01 14:09:39 +02:00 committed by GitHub
parent 0b80ba3fa6
commit f3ed2968bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -202,10 +202,10 @@ Function Write-CMTraceLog
#Write back to the host if $Writebacktohost is true. #Write back to the host if $Writebacktohost is true.
if(($WriteBackToHost)){ if(($WriteBackToHost)){
Switch ($PSCmdlet.GetVariableValue('InformationPreference')){ Switch ($PSCmdlet.GetVariableValue('InformationPreference')){
'Continue' {$InformationPreference = 'Continue'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} 'Continue' {$InformationPreference = [System.Management.Automation.ActionPreference]::Continue; Write-Information "INFORMATION: $Message" -InformationAction Continue ; $InformationPreference = ''}
'Inquire' {$InformationPreference = 'Inquire'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} 'Inquire' {$InformationPreference = [System.Management.Automation.ActionPreference]::Inquire; Write-Information "INFORMATION: $Message" -InformationAction Inquire; $InformationPreference = ''}
'Stop' {$InformationPreference = 'Stop'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} 'Stop' {$InformationPreference = [System.Management.Automation.ActionPreference]::Stop; Write-Information "INFORMATION: $Message" -InformationAction Stop; $InformationPreference = ''}
'Suspend' {$InformationPreference = 'Suspend';Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} 'Suspend' {$InformationPreference = [System.Management.Automation.ActionPreference]::Suspend; Write-Information "INFORMATION: $Message" -InformationAction Suspend; $InformationPreference = ''}
} }
} }
} }