我有一个我创建的 UWP 应用程序,想使用 powershell 在桌面上创建一个快捷方式。
为exe创建快捷方式很容易
$TargetFile = "\Path\To\MyProgram.exe"
$ShortcutFile = "$env:USERPROFILE\Desktop\MyShortcut.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.Save()
Run Code Online (Sandbox Code Playgroud)
但是我正在为通用应用程序的目标使用什么而苦苦挣扎。