Change output info from 'Write-Warning' to 'Write-Host' to make sure it's displayed even in RunSpaces as well as PowerShell 5 Environments

This commit is contained in:
Mr.k 2024-08-26 17:11:15 +03:00
parent 8ccde4fa59
commit cea227fd63
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -65,8 +65,8 @@ function Set-WinUtilUITheme {
}
}
catch {
Write-Debug "[Set-WinUtilTheme] Unable to apply theme"
Write-Debug $psitem.Exception.Message
Write-Host "[Set-WinUtilTheme] Unable to apply theme" -ForegroundColor Red
Write-Host "$($psitem.Exception.Message)" -ForegroundColor Red
$inputXML = "" # Make inputXML equal an empty string, indicating something went wrong to the function caller.
}

View File

@ -64,8 +64,8 @@ if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
$inputXML = Set-WinUtilUITheme -inputXML $inputXML -customThemeName $ctttheme
if ($inputXML -eq "") {
Write-Warning "Failed to statically apply theming to xaml content using Set-WinUtilTheme, please check previous Error/Warning messages."
Write-Warning "Quitting winutil..."
Write-Host "Failed to statically apply theming to xaml content using Set-WinUtilTheme, please check previous Error/Warning messages." -ForegroundColor Red
Write-Host "Quitting winutil..." -ForegroundColor Red
$sync.runspace.Dispose()
$sync.runspace.Close()
[System.GC]::Collect()
@ -93,8 +93,8 @@ try {
}
if (-NOT ($readerOperationSuccessful)) {
Write-Warning "Failed to parse xaml content using Windows.Markup.XamlReader's Load Method."
Write-Warning "Quitting winutil..."
Write-Host "Failed to parse xaml content using Windows.Markup.XamlReader's Load Method." -ForegroundColor Red
Write-Host "Quitting winutil..." -ForegroundColor Red
$sync.runspace.Dispose()
$sync.runspace.Close()
[System.GC]::Collect()