major change to override Write-Error func
This commit is contained in:
@@ -11,10 +11,10 @@ Function Write-LineToFile {
|
||||
If ( -not (Test-Path $Path) ) {
|
||||
Write-Output "Creating file ""${Path}"""
|
||||
Try { New-Item -Path $Path -ItemType File -Force | Out-Null }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
}
|
||||
Try { Add-Content -Path $Path -Value $Line }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Function to test whether or not an item has a specified property
|
||||
@@ -68,7 +68,7 @@ Function Get-ItemPropertyInfo {
|
||||
## Set $retval to a standard datetime format
|
||||
$retval = $date.ToString('yyyy-MM-dd')
|
||||
}
|
||||
Catch { LogErr $_.Exception.Message; $retval = $origRetval }
|
||||
Catch { Write-Error $_.Exception.Message; $retval = $origRetval }
|
||||
}
|
||||
Default {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user