mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
fix shortcut creation (#2488)
* fix shortcut creation - using vars that actually exist instead of imaginary ones. - remove empty row at the start of the file * cleanup remove unneccessary empty row
This commit is contained in:
parent
a77ef020fe
commit
97f67fa4b2
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
function Invoke-WPFShortcut {
|
function Invoke-WPFShortcut {
|
||||||
<#
|
<#
|
||||||
|
|
||||||
@ -32,7 +31,6 @@ function Invoke-WPFShortcut {
|
|||||||
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
||||||
|
|
||||||
$DestinationName = "WinUtil.lnk"
|
$DestinationName = "WinUtil.lnk"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +50,8 @@ function Invoke-WPFShortcut {
|
|||||||
# Prepare the Shortcut paramter
|
# Prepare the Shortcut paramter
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
$WshShell = New-Object -comObject WScript.Shell
|
||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
||||||
$Shortcut.TargetPath = $SourceExe
|
$Shortcut.TargetPath = $shell
|
||||||
$Shortcut.Arguments = $ArgumentsToSourceExe
|
$Shortcut.Arguments = $shellArgs
|
||||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
if (Test-Path -Path $winutildir["logo.ico"]) {
|
||||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
$shortcut.IconLocation = $winutildir["logo.ico"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user