PowerShell Will Not Scroll Vertically – Here’s the Fix

PowerShell has been a part of Windows 10 for a long time now. It is a basic feature of the OS that means that the device is out of the box by everyone. It is not as popular as Command Prompt but this command line shell has its own unique features that set it apart from Command Prompt.

On Windows 10, there are many actions that can only be executed from PowerShell such as removing stock apps from the OS, re-registering and reinstalling the UWP app and the Windows Store, running scripts written specifically on a shon, srl.

At the heart of the work, PowerShell remains a command line tool but uses commands and allows users to add modules that can extend what it can do.

PowerShell will not scroll

Like any Terminal, PowerShell can scroll in all directions ie, you can check the history of the commands you executed in the normal session, and you can scan to the end, and beyond, of the last command you executed.

If you are unable to view the PowerShell window, try the following.

1. PowerShell buffer size

However, the default PowerShell buffer size allows users to scan a few lines forwards or backwards, if your window is not scrolling at all or if the scrolling is not going as far back as you want, resize the PowerShell buffer.

  1. Open a PowerShell window.
  2. Right-click on the title bar and select real estate from the context menu.
  3. Go to Tab shape.
  4. in the ‘Screen Buffer Size’ Section, set the Height to 3000.
  5. Click OK.

Note: to apply this setting for a PowerShell admin user, open PowerShell with admin rights and then follow the steps above.

2. Increase the size of PowerShell history

PowerShell can store the history of run commands, and the output for the normal session however has its own history. Increase the size of the history to the maximum and you will be able to move further back.

The is the minimum value that can be set for history 1 and the the maximum value is 32767. The the default value is 4096.

  1. Open PowerShell.
  2. Run the following command to resize history for PowerShell.
$MaximumHistoryCount = 10000

Note: Replace 10000 with the size you want to set for the history.

3. PowerShell history log

PowerShell saves history only for the current session. If you cannot scan the PowerShell window, you can save the history to a log file and view it in a text editor such as Notepad or Notepad ++.

To record the history, you need to run the following command at the beginning of a PowerShell session. All commands you run, and their results, are written continuously to this file.

Start-Transcript -Path “[Save-Location]PowershellSession.log

4. Use the More command

If you need to go through a command line output, you can use the More command and cross one line at a time.

Run the command using the following system

[command] | more

The result will be displayed in the visible part of the window with ‘more’ breaks at the end. Tap on the Enter key go to the next line.

Conclusion

PowerShell usually does not require any output to move forward; if you have a PowerShell window open and you did not execute any commands, you will still be able to scroll down. Scrolling back is not disabled or blocked if the device history feature is not enabled properly or the buffer is set to a low value.

The post PowerShell Does Not Scroll Vertically – This is the Fix that first appears on TechtricksNg.

Leave a Comment

Advertisements
×