create_desktop_shortcut

1.2.0

Self-elevates to Administrator in the active PowerShell runtime (with STA mode on PS 5.1) with its
own console window hidden, automatically matches Windows 11 Dark/Light mode (with an in-app toggle),
lets you browse for a .ps1 script, choose between PowerShell 5.1 and PowerShell 7.x (with automatic
installation if missing), pick and preview a custom or Windows shell i
Self-elevates to Administrator in the active PowerShell runtime (with STA mode on PS 5.1) with its
own console window hidden, automatically matches Windows 11 Dark/Light mode (with an in-app toggle),
lets you browse for a .ps1 script, choose between PowerShell 5.1 and PowerShell 7.x (with automatic
installation if missing), pick and preview a custom or Windows shell icon, configure launch flags,
preview the exact command, and save the resulting .lnk shortcut directly to the Desktop.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name create_desktop_shortcut

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 waresoft. All rights reserved.

Package Details

Author(s)

  • waresoft

Tags

PowerShell Automation

Functions

Get-Pwsh7Info Invoke-AsyncTask Get-SystemDarkMode Apply-StatusStyle Apply-Theme

Dependencies

This script has no dependencies.

Release Notes

v1.2.0:
- Aligned PowerShell 5.1 / 7.x mode selection, Get-Pwsh7Info detection, inline status indicator, and background winget/GitHub MSI installation with PSGallery-Manager.
- Added the "Windows Icons..." button (shell32.dll) alongside "Choose Icon..." and "Reset".
- Preserved the active PowerShell host executable across UAC self-elevation via (Get-Process -Id $PID).Path and restricted -STA to Windows PowerShell 5.1.
- Fixed Add-Type compilation on PowerShell 7 (.NET 8+) by dynamically resolving loaded assembly locations for -ReferencedAssemblies.
- Forced foreground window activation (SW_SHOW + SetForegroundWindow) on form startup and ensured deterministic COM release before binary UAC patching.
v1.1.0:
- Hid the PowerShell console window when running this utility via hidden relaunch flags and Win32 ShowWindow fallback.
- Added a "Hidden" option to the Window dropdown to create shortcuts that execute target scripts with -WindowStyle Hidden (and start minimized to prevent window flash).
- Automatically disables -NoExit when "Hidden" is selected to prevent orphaned background PowerShell processes.
- Updated the live command preview to reflect -WindowStyle Hidden dynamically.

FileList

Version History

Version Downloads Last updated
1.2.0 (current version) 12 11/26/2026
1.1.0 12 11/22/2026
1.0.0 9 11/22/2026