Author Posts

February 4, 2016 at 7:19 am

When I come back to ISE after looking at something else, getting food, using restroom, etc., I find the file I was working on (in the scripting pane) is not saved. I want to see what the last thing I modified was because sometimes, it's just a random character my cat/child/self hit on the keyboard. In many editors, when you hit undo/redo, it jumps to that point in the code and it's easy to see the change that it's (un)making.

Even with ISE, when your cursor is not within the viewing window and you type something, it jumps to the changed line. However, this does not appear to be the case when using Undo/Redo. If the changed line is not actively within the viewing window, you see no change when using Undo/Redo. In a 1500+ line script, having to do Ctrl+Z, Ctrl+Y over and over again as you scroll down the file, hoping to visually see the change is not really an efficient approach. Nor is saving as a new file and diffing the new and old and deleting the undesired. Is there any option or setting or something that can get ISE to follow the "jump to change/cursor" action it uses when typing at a cursor location off the viewing screen, for Undo/Redo as well? Or some way to easily/quickly identify the location of a change?

EDIT: Clarified I'm working in the Scripting Pane

Edit2: Looks like this is a feature request: https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11087958-windows-powershell-ise-caret-and-view-do-not-jump

February 4, 2016 at 7:23 am

try get-history to see what happened last

edit: sorry i misread your OP. i thought you had entered a change and was looking for where, not changed something in the scripting pane of ISE and hadn't executed it yet.

February 4, 2016 at 7:49 am

Mike, thanks. I edited the original for clarity.