Add Another Catch Statement with some 'Write-Warning' for Extra Information

This commit is contained in:
Mr.k
2024-04-30 00:59:17 +03:00
parent 84ac49dec5
commit db638e13bc

View File

@ -25,6 +25,10 @@ function Test-WinUtilPackageManager {
try {
$wingetVersionFull = winget --version
} catch [System.Management.Automation.CommandNotFoundException], [System.Management.Automation.ApplicationFailedException] {
Write-Warning "Winget was not found due to un-availablity reasons"
$wingetExists = $false
} catch {
Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)"
$wingetExists = $false
}