$ErrorActionPreference = "Stop" $VSPath = "C:/Program Files/Microsoft Visual Studio/2022/Community" Import-Module "$VSPath/Common7/Tools/Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $VSPath $command = "cl" foreach ($arg in $args) { $command += " `"$arg`"" } Write-Host "Build Command: `n$command`n" Invoke-Expression $command