In PowerShell, when you write the name of a variable alone on a line of script, that displays its value on the console (at execution, naturally).
If you want a line number in front of it, you can write it in the code, but it will not be updated when you insert or suppress lines.
If you want to execute step by step, you have to use PowerShell ISE, that you will find in the start menu of Windows.
Then, you can put breakpoints, and starting from a breakpoint execute step by step with the F11 key.
During the stop at a breakpoint, you can get the value of a variable by positioning the mouse cursor on it.
1 Like