What's New in v1.2.0
- PowerShell 5.1 & 7.x Support: Choose between PowerShell 5.1 (
powershell.exe) and PowerShell 7.x (pwsh.exe) via the new PowerShell Mode dropdown, backed by Get-Pwsh7Info detection across InstalledVersions registry keys, App Paths, MSI, and MSIX (WindowsApps) installs.
- One-Click PowerShell 7 Installer: Automatically prompts to download and install PowerShell 7 in the background (
winget with GitHub .msi fallback) if pwsh.exe is not installed.
- Built-In Windows Icon Gallery: Added a Windows Icons... button to browse
shell32.dll directly alongside Choose Icon... and Reset.
Improvements & Fixes
- Runtime-Aware
-STA & Host Elevation: Injects -STA only for Windows PowerShell 5.1 (preventing invalid-argument errors in PowerShell 7) and preserves the active PowerShell host binary across UAC self-elevation via (Get-Process -Id $PID).Path.
- PowerShell 7 / .NET 8+ Compatibility: Dynamically resolves loaded assembly locations for
Add-Type -ReferencedAssemblies so Win32ShellHelper compiles cleanly on both PowerShell 5.1 and 7.x.
- Foreground Activation & COM Cleanup: Forces foreground focus (
SW_SHOW + SetForegroundWindow) on startup and deterministically releases WScript.Shell COM objects before patching .lnk UAC elevation bytes.
Install or Update
Install-Script -Name create_desktop_shortcut -Force
Update-Script -Name create_desktop_shortcut -Force
