major logging overhaul, plus other fixes
This commit is contained in:
@@ -4,8 +4,9 @@ $InstallLocation = "${Env:Public}\Desktop\Deltek Vision.lnk"
|
||||
## Remove the existing shortcut
|
||||
If ( Test-Path $InstallLocation )
|
||||
{
|
||||
LogMsg "Deleting ""${InstallLocation}"""
|
||||
Try { Remove-Item -Path $InstallLocation -Force }
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Get the correct path to IE
|
||||
@@ -17,6 +18,7 @@ If ( $VisionURL )
|
||||
## Make sure IE exists where we expect it to
|
||||
If ( Test-Path $IEPATH )
|
||||
{
|
||||
LogMsg "Creating shortcut at ""${InstallLocation}"""
|
||||
Try
|
||||
{
|
||||
$WshShell = New-Object -ComObject WScript.Shell
|
||||
@@ -28,6 +30,6 @@ If ( $VisionURL )
|
||||
$Shortcut.TargetPath = "${IEPATH}"
|
||||
$Shortcut.Save()
|
||||
}
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
} Else { Write-Output "Internet Explorer could not be found: ${IEPATH}" }
|
||||
} Else { Write-Output "No URL to Deltek Vision was specified!" }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
} Else { LogMsg "Internet Explorer could not be found: ${IEPATH}" }
|
||||
} Else { LogMsg "No URL to Deltek Vision was specified!" }
|
||||
|
||||
Reference in New Issue
Block a user