Skip to content

Commit 3da08cc

Browse files
committed
Update Enable-CippConsoleLogging.ps1
1 parent 4c9126a commit 3da08cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Modules/CIPPCore/Public/Tools/Enable-CippConsoleLogging.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function Enable-CippConsoleLogging {
8484
& $global:SendCippConsoleLog -Message ($MessageData | Out-String).Trim() -Level ([CippConsoleLogLevel]::Information)
8585

8686
# Call original function
87-
& $global:CippOriginalWriteFunctions.Information.ScriptBlock @PSBoundParameters
87+
Microsoft.PowerShell.Utility\Write-Information @PSBoundParameters
8888
}
8989

9090
# Override Write-Warning
@@ -99,7 +99,7 @@ function Enable-CippConsoleLogging {
9999
& $global:SendCippConsoleLog -Message $Message -Level ([CippConsoleLogLevel]::Warning)
100100

101101
# Call original function
102-
& $global:CippOriginalWriteFunctions.Warning.ScriptBlock @PSBoundParameters
102+
Microsoft.PowerShell.Utility\Write-Warning @PSBoundParameters
103103
}
104104

105105
# Override Write-Error
@@ -128,7 +128,7 @@ function Enable-CippConsoleLogging {
128128
& $global:SendCippConsoleLog -Message $errorMessage -Level ([CippConsoleLogLevel]::Error)
129129

130130
# Call original function
131-
& $global:CippOriginalWriteFunctions.Error.ScriptBlock @PSBoundParameters
131+
Microsoft.PowerShell.Utility\Write-Error @PSBoundParameters
132132
}
133133

134134
# Override Write-Verbose
@@ -143,7 +143,7 @@ function Enable-CippConsoleLogging {
143143
& $global:SendCippConsoleLog -Message $Message -Level ([CippConsoleLogLevel]::Verbose)
144144

145145
# Call original function
146-
& $global:CippOriginalWriteFunctions.Verbose.ScriptBlock @PSBoundParameters
146+
Microsoft.PowerShell.Utility\Write-Verbose @PSBoundParameters
147147
}
148148

149149
# Override Write-Debug
@@ -158,7 +158,7 @@ function Enable-CippConsoleLogging {
158158
& $global:SendCippConsoleLog -Message $Message -Level ([CippConsoleLogLevel]::Debug)
159159

160160
# Call original function
161-
& $global:CippOriginalWriteFunctions.Debug.ScriptBlock @PSBoundParameters
161+
Microsoft.PowerShell.Utility\Write-Debug @PSBoundParameters
162162
}
163163

164164
# Override Write-Host
@@ -178,6 +178,6 @@ function Enable-CippConsoleLogging {
178178
& $global:SendCippConsoleLog -Message $message -Level ([CippConsoleLogLevel]::Information)
179179

180180
# Call original function
181-
& $global:CippOriginalWriteFunctions.Host.ScriptBlock @PSBoundParameters
181+
Microsoft.PowerShell.Utility\Write-Host @PSBoundParameters
182182
}
183183
}

0 commit comments

Comments
 (0)