The start menu features a Developer PowerShell for VS 2022 which defaults to x86:

PS C:\> (Get-Command link.exe).Source

C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\bin\HostX86\x86\link.exe

How can I change it to x64/amd64?

1 Reply 1

Create a start menu entry by copying the original and adding -Arch amd64

cp "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\Developer PowerShell for VS 2022.lnk" "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\x64 PowerShell.lnk"

$wsshell = New-Object -ComObject WScript.Shell
$shortcut = $wsshell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\x64 PowerShell.lnk")
$shortcut.Arguments = $shortcut.Arguments -replace '(Enter-VsDevShell)', '$1 -Arch amd64'

$shortcut.Save()

Which will give you x64/amd64:

PS C:\> (Get-Command link.exe).Source

C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.