prefer Edge over Internet Explorer

This commit is contained in:
2021-03-11 10:49:11 -05:00
parent 4d8fff82f1
commit c1709db895
+19 -8
View File
@@ -1,12 +1,23 @@
## Get the correct path to IE
If ( Test-Path "${Env:ProgramFiles(x86)}" ) { $IEPATH = "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe" }
Else { $IEPATH = "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe" }
If ( $VisionURL ) {
## Make sure IE exists where we expect it to
If ( Test-Path $IEPATH ) {
Create-Shortcut -Path "${Env:Public}\Desktop\Deltek Vision.lnk" -TargetPath $IEPATH -Arguments $VisionURL -Description "Launch Deltek Vision"
## Get the path to a compatible browser
If ( Test-Path "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe" ) {
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"
}
Else { LogMsg "Internet Explorer could not be found: ${IEPATH}" }
ElseIf ( Test-Path "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe" ) {
$BROWSER_PATH = "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe"
}
ElseIf ( Test-Path "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe" ) {
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe"
}
ElseIf ( Test-Path "${Env:ProgramFiles}\Internet Explorer\iexplore.exe" ) {
$BROWSER_PATH = "${Env:ProgramFiles}\Internet Explorer\iexplore.exe"
}
## Create the shortcut
If ( $BROWSER_PATH ) {
Create-Shortcut -Path "${Env:Public}\Desktop\Deltek Vision.lnk" -TargetPath $BROWSER_PATH -Arguments $VisionURL -Description "Launch Deltek Vision"
}
Else { LogMsg "A compatible browser could not be found: ${BROWSER_PATH}" }
}
Else { LogMsg "No URL to Deltek Vision was specified!" }