New-ElevatedShortcut
SYNOPSIS
Creates a shortcut to a script or exe that runs as admin, without UNC
SYNTAX
New-ElevatedShortcut [-ShortcutName] <String> [-FilePath] <String> [[-Credential] <PSCredential>] [-OpenPath]
[<CommonParameters>]
DESCRIPTION
Creates a shortcut to a script or exe that runs as admin, without UNC
EXAMPLES
EXAMPLE 1
New-ElevatedShortcut -ShortcutName blah -FilePath cmd.exe
PARAMETERS
-ShortcutName
Name of the shortcut
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FilePath
Path to the executable or ps1 file
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Credential
Use another userid to launch the task.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OpenPath
Open explorer to the .lnk file.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.