$Shell = New-Object -ComObject ("WScript.Shell") ## Delete the Desktop shortcut if it exists if ( Test-Path "${Env:UserProfile}\Desktop\Deltek Vision.lnk" ) { Remove-Item "${Env:UserProfile}\Desktop\Deltek Vision.lnk" -Force } ## Create Desktop shortcut try { $DesktopShortcut = $Shell.CreateShortcut("${Env:UserProfile}\Desktop\Deltek Vision.lnk") $DesktopShortcut.TargetPath = "${Env:ProgramFiles}\Internet Explorer\iexplore.exe" $DesktopShortcut.Arguments = "https://dbi.oursand.com/dbiclient/DeltekVision.application" $DesktopShortcut.WorkingDirectory = "${Env:ProgramFiles}\Internet Explorer" $DesktopShortcut.WindowStyle = 1 $DesktopShortcut.IconLocation = "${Env:ProgramFiles}\Internet Explorer\iexplore.exe, 0" $DesktopShortcut.Description = "Launch Deltek Vision" $DesktopShortcut.Save() } catch { Write-Host "Desktop shortcut to Deltek Vision could not be created!" } ## Delete the Favorites Bar shortcut if it exists if ( Test-Path "${Env:UserProfile}\Favorites\Links\Deltek Vision.url" ) { Remove-Item "${Env:UserProfile}\Favorites\Links\Deltek Vision.url" -Force } ## Create IE shortcut on Favorites Bar try { $IEShortcut = $Shell.CreateShortcut("${Env:UserProfile}\Favorites\Links\Deltek Vision.url") $IEShortcut.TargetPath = "https://dbi.oursand.com/dbiclient/DeltekVision.application" $IEShortcut.Save() } catch { Write-Host "Internet Explorer shortcut to Deltek Vision could not be created!" }