desktop shortcut

This commit is contained in:
Joey Eamigh
2023-06-22 17:01:04 -04:00
parent d9b87f40ef
commit 315746073d
5 changed files with 26 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
# got to the directory where the script is located
Push-Location $PSScriptRoot
# check if winget is installed and if so, set a flag to true
$winget = Get-Command winget -ErrorAction SilentlyContinue
# trust desktop-shortcut.ps1 for good measure
Unblock-File .\desktop-shortcut.ps1
if (!$winget) {
Write-Host "Error: winget is not installed." -Foreground Red
Write-Host "This script will not work without winget." -Foreground Red

View File

@@ -0,0 +1,12 @@
# creates a desktop shortcut to run client.ps1 in powershell
$ClientFile = "$PSScriptRoot\client.ps1"
$ShortcutPath = "$Home\Desktop\FishPog Pixelmon.lnk"
$IconPath = "$PSScriptRoot\icon.ico"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = "powershell.exe"
$Shortcut.Arguments = "-ExecutionPolicy Bypass -File `"$ClientFile`""
$Shortcut.IconLocation = $IconPath
$Shortcut.Save()

BIN
client/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB