From 4a9196d87ece0d4f08ec56eb4f249fc164b11c3f Mon Sep 17 00:00:00 2001 From: rvrsh3ll Date: Thu, 20 Oct 2022 06:18:39 -0400 Subject: [PATCH] Added PDF Extension --- Create-HotKeyLNK.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Create-HotKeyLNK.ps1 b/Create-HotKeyLNK.ps1 index e10fb2f..9399361 100644 --- a/Create-HotKeyLNK.ps1 +++ b/Create-HotKeyLNK.ps1 @@ -22,7 +22,7 @@ function Create-HotKeyLNK { .PARAMETER IconPath - Path to an exe for an icon. Defaults to Internet Explorer. + Path to an exe for an icon. Defaults to Internet Explorer. Use "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe,13" for PDF extension. .PARAMETER HotKey @@ -60,6 +60,10 @@ function Create-HotKeyLNK { [String] $IconPath = "$env:programfiles\Internet Explorer\iexplore.exe", + [Parameter(Mandatory=$False)] + [Switch] + $PDFIcon, + [Parameter(Mandatory=$False)] [String] $HotKey = "CTRL+V", @@ -83,7 +87,11 @@ function Create-HotKeyLNK { $link.WindowStyle = '7' $link.TargetPath = $EXEPath $link.HotKey = $HotKey - $link.IconLocation = $IconPath + if ($PDFIcon) { + $link.IconLocation = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe,13" + } else { + $link.IconLocation = $IconPath + } $link.Arguments = $arguments $link.Save() Write-Host "Done!"