I'm using PowerShell and a Chocolatey cmdlet Install-ChocolateyPinnedTaskBarItem
and attempting to pin the Hyper-V Manager shortcut to the Windows taskbar. This is a 64 bit installation of Windows.
Normally you can call:
Install-ChocolateyPinnedTaskBarItem "$env:programfiles\Notepad++\notepad++.exe"
We know it's virtmgmt.msc
. When you inspect its existing taskbar shortcut, you see that it's:
%windir%\system32\mmc.exe "%windir%\system32\virtmgmt.msc"
I've attempted to use the built-in $env:windir
:
Install-ChocolateyPinnedTaskBarItem '$env:WinDir\system32\mmc.exe "$env:WinDir\system32\virtmgmt.msc"'
This fails with:
'$env:WinDir\system32\mmc.exe "$env:WinDir\system32\virtmgmt.msc"' does not exist, not able to pin to task bar
How can I pin an MMC shortcut like Hyper-V manager to the taskbar using Install-ChocolateyPinnedTaskBarItem
? Should I use plain old windir%
?