major logging overhaul, plus other fixes

This commit is contained in:
2020-10-22 14:01:35 -04:00
parent 77cf4d6276
commit 978373ebe2
27 changed files with 430 additions and 611 deletions
+6 -4
View File
@@ -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!" }