5

I'm using Powershell ISE for running some batch scripts. The outputs will be long and these programs will run for quite a some time. The problem I'm facing is I'm unable to lock the console output to any position to be able to read some errors that are displayed? Is there anyway to lock the scroll even when new output is being appended at the end of the console output?

1

From what I gather ISE does not support pausing the output. you can stop it with Ctrl+c but can not resume it. Instead what may be useful for you. You can send the console output to a file for perusing. I found two codes depending on the version of ISE you are using. I believe you change "Test" to what you are trying to output.

PowerShell version 3:

Clear
Write-Host 'Test'
Start-Sleep 1
$psise.CurrentPowerShellTab.ConsolePane.Text | Set-Content -Path iseoutput.txt

PowerShell version 2:

Clear
Write-Host 'Test'
Start-Sleep 1
$psise.CurrentPowerShellTab.Output.Text | Set-Content -Path iseoutput.txt

This was the best I could find as Powershell ISE doesn't use Pause like cmd. Another option is if it is possible for you to run your script in Powershell (not ISE) then you can pause output with Ctrl+s.

If this is not what you are looking for, I am sorry as I only use Powershell (not ISE) instead of cmd.

  • 1
    could not believe ISE does not support CTRL+s/q yet the standard powershell command window does. Thanks for the clarification. – rob Dec 2 '16 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.