From 97f67fa4b246a6dd9c8452663b8e18e532df09b2 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 6 Aug 2024 19:53:41 +0200 Subject: [PATCH] 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 --- functions/public/Invoke-WPFShortcut.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions/public/Invoke-WPFShortcut.ps1 b/functions/public/Invoke-WPFShortcut.ps1 index 513ede95..d82f6ccd 100644 --- a/functions/public/Invoke-WPFShortcut.ps1 +++ b/functions/public/Invoke-WPFShortcut.ps1 @@ -1,4 +1,3 @@ - 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`"`'" $DestinationName = "WinUtil.lnk" - } } @@ -52,8 +50,8 @@ function Invoke-WPFShortcut { # Prepare the Shortcut paramter $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName) - $Shortcut.TargetPath = $SourceExe - $Shortcut.Arguments = $ArgumentsToSourceExe + $Shortcut.TargetPath = $shell + $Shortcut.Arguments = $shellArgs if (Test-Path -Path $winutildir["logo.ico"]) { $shortcut.IconLocation = $winutildir["logo.ico"] }