On windows 10, the output of any powershell command is displayed with additional vertical spaces. If you execute commands in sequence, on a 80x24 terminal session, you see more empty space than text. I looked around for powershell's default formatting, to change it, but did not find anything useful. Can you take me out of this misery please?

Example of code that shows the problem:

Get-NetAdapter | select Name,Status | format-table -autosize; Get-NetAdapterAdvancedProperty -AllProperties -RegistryKeyword *Flo*rol,*SpeedDuplex,*JumboPacket,*Wake* | format-table Name,RegistryKeyword,DisplayValue,RegistryValue -autosize; Get-WmiObject win32_networkadapterconfiguration -filter "IPEnabled='true'" | select Description,MACaddress,DHCPenabled,IPaddress,IPsubnet,DefaultIPGateway,DNSServerSearchorder,DNSdomain,Index
  • Can you provide some code that shows the issue? Because I have never run into that problem myself.
    – flolilo
    Oct 11, 2017 at 15:51
  • A screen shot of your issue would help us understand your question. Upload any image(s) to Imgur and you will get link(s) you can share. Edit your question to include the link(s) and someone with sufficient reputation will inline the image(s) for you.
    – DavidPostill
    Oct 11, 2017 at 16:49
  • I said any command. I see two empty lines before and after each output. If you run two commands in a raw, for example in a script, there is a gap of 4 empty lines between executions.
    – Rupert
    Oct 12, 2017 at 7:15
  • What, like Write-Output "Test"? I have never seen that happen. If we are talking about things like Get-ChildItem that offer a bit of "graphical layout": why not use $a = Get-ChildItem; $a | Format-Table -Property Name,LastWriteTime,Length -AutoSize? Granted, that still only saves one line-break.
    – flolilo
    Oct 13, 2017 at 21:26
  • AutoSize takes care of the horizontal space only.
    – Rupert
    Oct 17, 2017 at 8:52


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.