and lots of other iterations, but it doesn’t like the URL. I have another link that looks like “microsoft-edge:https:\somesite.com” and this works fine. I tried “explorer:https\url” and “javaws:” and “javaws.exe” and no joy. It makes the shortcut but requests the application.
Any help or am I trying to do a thing in a dumb way?
TIP: Sometimes you need to look at the source instead of the manual.
If you look in \AppDeployToolkit\AppDeployToolkitMain.ps1 for the definition of the New-Shortcut function, it starts with this:
#region Function New-Shortcut
Function New-Shortcut {
<#
.SYNOPSIS
Creates a new .lnk or .url type shortcut
.DESCRIPTION
Creates a new shortcut .lnk or .url file, with configurable options
.PARAMETER Path
Path to save the shortcut
.PARAMETER TargetPath
Target path or URL that the shortcut launches
.PARAMETER Arguments
Arguments to be passed to the target path
.PARAMETER IconLocation
Location of the icon used for the shortcut
.PARAMETER IconIndex
The index of the icon. Executables, DLLs, ICO files with multiple icons need the icon index to be specified. This parameter is an Integer. The first index is 0.
.PARAMETER Description
Description of the shortcut
.PARAMETER WorkingDirectory
Working Directory to be used for the target path
.PARAMETER WindowStyle
Windows style of the application. Options: Normal, Maximized, Minimized. Default is: Normal.
.PARAMETER RunAsAdmin
Set shortcut to run program as administrator. This option will prompt user to elevate when executing shortcut.
.PARAMETER Hotkey
Create a Hotkey to launch the shortcut, e.g. "CTRL+SHIFT+F"
.PARAMETER ContinueOnError
Continue if an error is encountered. Default is: $true.
.EXAMPLE
New-Shortcut -Path "$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk" -TargetPath "$envWinDir\system32\notepad.exe" -IconLocation "$envWinDir\system32\notepad.exe" -Description 'Notepad' -WorkingDirectory "$envHomeDrive\$envHomePath"
.NOTES
Url shortcuts only support TargetPath, IconLocation and IconIndex. Other parameters are ignored.
.LINK
http://psappdeploytoolkit.com
#>