The "Visual Studio Team" at https://developercommunity.visualstudio.com/comments/26893/view.html stated that the description for --wait is incorrect: "The Visual Studio team has determined that this issue is not a bug. The --wait option documentation may be misleading but it is for a different purpose. When running from CMD or PS shell please use the call command which will wait for the process to wait." Please update the description for --wait to describe what it actually does.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@cowlinator Thanks for your feedback; we'll investigate and report back.
@tydunkel Can you verify, please?
@cowlinator Thank you for the feedback! The --wait command description is correct, the vs_<SKU>.exe process will wait to close until after the install is complete. However, different command utilities behave differently when given commands. Batch scripts will wait for a process to quit before continuing, so --wait will block until the install completes. Powershell scripts will not block for processes to exit, so --wait alone is not enough to block a Powershell script while the install completes.
e.g. To block a Powershell script from continuing:
$returnCode = Start-Process -FilePath vs_community.exe -ArgumentList "--installPath", "C:\VS", "--passive", "--wait" -Wait -PassThru
or
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "vs_enterprise.exe"
$startInfo.Arguments = "--all --quiet --wait"
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start()
$process.WaitForExit()
We should probably add these examples to Command-line parameter examples for Visual Studio 2017 installation.
Thank you for the response.
I agree that additional examples would be very helpful.
@TerryGLee FYI - we will work on adding more examples to the docs for this since it is a common point of confusion.
@tydunkel I am assigning the content updates to the April sprint; FYI.
@cowlinator As previously stated, the description of the --wait parameter is correct, but we have updated the "Using --wait" section of the Command-line parameter examples page to include PowerShell examples. We'll close this issue now; however, you can still add comments to it, should you wish.
Thanks for helping us to improve our documentation!
Most helpful comment
@cowlinator Thank you for the feedback! The
--waitcommand description is correct, thevs_<SKU>.exeprocess will wait to close until after the install is complete. However, different command utilities behave differently when given commands. Batch scripts will wait for a process to quit before continuing, so--waitwill block until the install completes. Powershell scripts will not block for processes to exit, so--waitalone is not enough to block a Powershell script while the install completes.e.g. To block a Powershell script from continuing:
or
We should probably add these examples to Command-line parameter examples for Visual Studio 2017 installation.