I have a project with a few post-build event commands. These commands take some time to complete and also have console output. If it matters, the commands are PowerShell commands/scripts. What I've found is Visual Studio will act like it is not responding while the commands execute. Once the commands have all executed, the entire output displays in the Output window in VS when the build finishes. What I'd like is for the Output window to display the console output as it happens so when my scripts run I would see "Beginning command execution...", "Command 1 complete, beginning command 2...", something like that. Is this possible?
Here's what my post-build event commands look like:
if "$(ConfigurationName)" == "Release" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Set-ExecutionPolicy Unrestricted
if "$(ConfigurationName)" == "Release" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -file "$(SolutionDir)\installshieldAutomationScript.ps1"
if "$(ConfigurationName)" == "Release" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Set-ExecutionPolicy Restricted
Here's a snippet of my PowerShell script:
Write-Host "Running post-build script..." -ForegroundColor "Green"
#Do a bunch of stuff here
Write-Host "Post-build script complete!" -ForegroundColor "Cyan"