mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-25 23:59:07 +08:00
22 lines
516 B
PowerShell
22 lines
516 B
PowerShell
|
[CmdletBinding()]
|
||
|
param(
|
||
|
[Parameter()]
|
||
|
[string]$SourceExe,
|
||
|
[string]$Arguments,
|
||
|
[string]$DestinationPath,
|
||
|
[string]$WorkingDirectory,
|
||
|
[String]$IconLocation
|
||
|
)
|
||
|
|
||
|
if ($IconLocation -eq '') {
|
||
|
$IconLocation = $SourceExe
|
||
|
}
|
||
|
|
||
|
$WshShell = New-Object -comObject WScript.Shell
|
||
|
$Shortcut = $WshShell.CreateShortcut($destinationPath)
|
||
|
$Shortcut.TargetPath = $SourceExe
|
||
|
$Shortcut.Arguments = $Arguments
|
||
|
$shortcut.WorkingDirectory = $WorkingDirectory
|
||
|
$shortcut.IconLocation = $IconLocation
|
||
|
$Shortcut.Save()
|