PS 5.1, Get-ComputerInfo generates blank lines at the top

Just out of curiosity: Why? :thinking:

Does it have a technical reason or is it just bothering you? If it’s the latter I’d recommend focussing on more rewarding tasks than spending a lot of effort to tinker around to remove one single emptly line from the output.

If you insist you could convert the output to a string an remove all empty lines from it before you output it.

Another option would be to use PowerShell 7.x. There Write-Output does not add an additional empty line to the output.

1 Like