From f3ed2968bcde9abefb9f259b6be53822b143bacf Mon Sep 17 00:00:00 2001 From: Andrzej Demski <75534654+AndrewDemski-ad-gmail-com@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:09:39 +0200 Subject: [PATCH] Update Write-CMTraceLog.ps1 --- .../WAU/Winget-AutoUpdate/functions/Write-CMTraceLog.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Write-CMTraceLog.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Write-CMTraceLog.ps1 index eccd69a..a81ca27 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Write-CMTraceLog.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Write-CMTraceLog.ps1 @@ -202,10 +202,10 @@ Function Write-CMTraceLog #Write back to the host if $Writebacktohost is true. if(($WriteBackToHost)){ Switch ($PSCmdlet.GetVariableValue('InformationPreference')){ - 'Continue' {$InformationPreference = 'Continue'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} - 'Inquire' {$InformationPreference = 'Inquire'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} - 'Stop' {$InformationPreference = 'Stop'; Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} - 'Suspend' {$InformationPreference = 'Suspend';Write-Information -Message "INFORMATION: $Message";$InformationPreference = ''} + 'Continue' {$InformationPreference = [System.Management.Automation.ActionPreference]::Continue; Write-Information "INFORMATION: $Message" -InformationAction Continue ; $InformationPreference = ''} + 'Inquire' {$InformationPreference = [System.Management.Automation.ActionPreference]::Inquire; Write-Information "INFORMATION: $Message" -InformationAction Inquire; $InformationPreference = ''} + 'Stop' {$InformationPreference = [System.Management.Automation.ActionPreference]::Stop; Write-Information "INFORMATION: $Message" -InformationAction Stop; $InformationPreference = ''} + 'Suspend' {$InformationPreference = [System.Management.Automation.ActionPreference]::Suspend; Write-Information "INFORMATION: $Message" -InformationAction Suspend; $InformationPreference = ''} } } }