force recreating shortcut
This commit is contained in:
@@ -1,29 +1,34 @@
|
|||||||
$SHORTCUT_PATH = "${Env:Public}\Desktop\Deltek Vision.lnk"
|
$SHORTCUT_PATH = "${Env:Public}\Desktop\Deltek Vision.lnk"
|
||||||
|
|
||||||
|
# Remove the shortcut if it already exists
|
||||||
|
If ( Test-Path $SHORTCUT_PATH ) { LogMsg "Removing existing shortcut: ${SHORTCUT_PATH}" ; Remove-Item $SHORTCUT_PATH }
|
||||||
|
|
||||||
|
# If the shortcut doesn't exist
|
||||||
If ( -not (Test-Path $SHORTCUT_PATH) ) {
|
If ( -not (Test-Path $SHORTCUT_PATH) ) {
|
||||||
If ( $VisionURL ) {
|
If ( $VisionURL ) {
|
||||||
|
|
||||||
## Get the path to a compatible browser
|
## Get the path to a compatible browser
|
||||||
If ( Test-Path "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe" ) {
|
If ( Test-Path "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe" ) {
|
||||||
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"
|
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"
|
||||||
$APP_NAME = "Edge (x64)"
|
$APP_NAME = "Microsoft Edge (x64)"
|
||||||
}
|
}
|
||||||
ElseIf ( Test-Path "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe" ) {
|
ElseIf ( Test-Path "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe" ) {
|
||||||
$BROWSER_PATH = "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe"
|
$BROWSER_PATH = "${Env:ProgramFiles}\Microsoft\Edge\Application\msedge.exe"
|
||||||
$APP_NAME = "Edge (x86)"
|
$APP_NAME = "Microsoft Edge (x86)"
|
||||||
}
|
}
|
||||||
ElseIf ( Test-Path "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe" ) {
|
ElseIf ( Test-Path "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe" ) {
|
||||||
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe"
|
$BROWSER_PATH = "${Env:ProgramFiles(x86)}\Internet Explorer\iexplore.exe"
|
||||||
$APP_NAME = "Internet Explorer (x64)"
|
$APP_NAME = "Microsoft Internet Explorer (x64)"
|
||||||
}
|
}
|
||||||
ElseIf ( Test-Path "${Env:ProgramFiles}\Internet Explorer\iexplore.exe" ) {
|
ElseIf ( Test-Path "${Env:ProgramFiles}\Internet Explorer\iexplore.exe" ) {
|
||||||
$BROWSER_PATH = "${Env:ProgramFiles}\Internet Explorer\iexplore.exe"
|
$BROWSER_PATH = "${Env:ProgramFiles}\Internet Explorer\iexplore.exe"
|
||||||
$APP_NAME = "Internet Explorer (x86)"
|
$APP_NAME = "Microsoft Internet Explorer (x86)"
|
||||||
}
|
}
|
||||||
|
|
||||||
## Create the shortcut
|
## Create the shortcut
|
||||||
If ( $BROWSER_PATH ) {
|
If ( $BROWSER_PATH ) {
|
||||||
|
|
||||||
LogMsg "Installing Deltek Vision using ${APP_NAME}"
|
LogMsg "Installing Deltek Vision for ${APP_NAME}"
|
||||||
Create-Shortcut -Path "${Env:Public}\Desktop\Deltek Vision.lnk" -TargetPath $BROWSER_PATH -Arguments $VisionURL -Description "Launch Deltek Vision"
|
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 "A compatible browser could not be found: ${BROWSER_PATH}" }
|
||||||
|
|||||||
Reference in New Issue
Block a user