Hi Varma, This will work for you. Another hint is to use the HCL syntax highlighter in VS Code; this enables you to see if the syntax is correct without running the code.
provisioner "powershell" {
inline = ["Write-Host 'Installing Visual studio Build Tools...'",
"New-Item -ItemType Directory -Path 'c:\\software'",
"cd c:\\software",
"Invoke-webRequest -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -UseBasicParsing -OutFile c:\\software\\vs_installer.exe",
"Write-Host 'Starting installation with selected components...'",
"$arguments = '--quiet --norestart --nocache --wait --noupdateInstaller --noweb --add \"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools\" --add \"Microsoft.VisualStudio.Workload.WebBuildTools\" --add \"Microsoft.VisualStudio.Workload.AzureBuildTools\" --add \"Microsoft.VisualStudio.Workload.DataBuildTools\" -- includeRecommended'",
"Start-Process c:\\software\\vs_installer.exe -Wait -ArgumentList $arguments"]
}