I would like to change the default height of the PowerShell screen buffer in Windows 10. (I have not tried to do this on other Windows versions.) It seems like it ought to be very simple.
If I right click on the PowerShell title bar, there’s a “Defaults” option in the contextual menu, and that opens a window with a tab that says “Layout”. Under that tab are screen buffer size options for “Width” and “Height”. So far, so good. There’s a problem, though: PowerShell only respects the default height setting until I restart my computer. Then the actual buffer height of new PowerShell windows is set to the screen height, even though the default seems to remain whatever value I set. How can I set a persistent default value? Perhaps there’s a configuration file of some sort that I should edit instead of using the defaults GUI?
(On a related note that doesn’t make much sense as a separate question, is the behaviour I’m observing intended or should I submit a bug report to Microsoft? It seems odd, but I don’t want to assume it’s a bug right off the bat because a lot of behaviours that I do not understand in popular software products are apparently intended.)
$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(160,5000)