major change to override Write-Error func
This commit is contained in:
@@ -8,11 +8,11 @@ If ( IsWindowsVersion -ge "10.0" ) {
|
||||
If ( Test-Path $FILE ) {
|
||||
Write-Output "Clearing Quick Access links"
|
||||
Try { Remove-Item $FILE -Force }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
} ElseIf ( Test-Path $FILEDIR ) {
|
||||
Write-Output "Standard Quick Access link list is not found, clearing out all automatic destinations instead"
|
||||
Try { Get-ChildItem "${FILEDIR}\*.*" | Where-Object { -not $_.PSIsContainer } | Remove-Item -Force }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
} Else {
|
||||
Write-Output "Quick Access lists cannot be found!"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user