5

With PowerShell ISE:

If using a split view (showing both the console and script pane), re-focusing on the console from the script pane (or another console tab) will always scroll to the bottom.

To observe this effect, scroll up in the console so that the prompt at the bottom is hidden (obviously you'll need some output if you want to scroll up). At this point, you can click anywhere in the console to select and copy text. You can even leave focus from the ISE and click on your favorite web browser or text editor, and click back in the ISE console and the scroll doesn't change.

The problem is when you click in the script pane. The second you lose focus from the console within the ISE, you have sealed your fate. The instant you click back into the console, it will scroll to the very bottom! Clicking on another console tab will also scroll it to the bottom.

I made the graphic below just in case my description was confusing. The colored circles represent clicks. Green clicks do NOT cause the console to scroll. The orange click seals the fate for a red click, which will scroll the console.

enter image description here

This issue makes it impractical to copy more than one item from the top of the console to the script pane, because you must scroll back up every time. You could copy everything into a separate text editor before pasting, but that is silly and almost equally impractical.

I have tried using CTRL+I and CTRL+D to switch between the script pane and the console, but the same scrolling effect occurs.

I am using PowerShell 3 on Windows 7.

2
  • upvoted for the interesting annotations. Feb 16, 2017 at 16:03
  • Just like you, I'm quite annoyed by this behaviour and the only workaround I could find is copying the content of the console pane and paste it to a new tab in the script pane. You have an extra step at first, but then switching between the tabs is way better than having to scroll back up to the row of interest every time. Oct 9, 2021 at 16:51

1 Answer 1

1

That's just the way it works. I doubt you will be able to do anything about it except to change the way you work. I think the way you are meant to use the ISE is you do everything in the script pane, and you press F8 to execute a particular line or selection. The console itself is relegated to being just for output and for quick experiments.

PowerGUI doesn't have the problem you mention. You might like to try using that instead. There are other PowerShell editors too, but I am not familiar with them. PowerGUI is good, and it's free.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .