I am a newcomer to PS scripting. I have found that, generally speaking, PS adds a lot of newlines to output of its commands. I am giving below a couple of examples of what I found somewhat generalized about the (default?) output in PS commands. I am used to Unix-like output, where the generalized output has few to none of these lines (of course, nothing prevents a programmer from adding them).
Is there a configurable way to reduce the amount of those newlines, and perhaps the verbosity?
I have compiled below a list of SO questions (and extra) dealing with specific cases, but none aims at a general setting. I could apply some of the answers on a command-by-command basis, but I am asking if there is some form of overall setting/configuring PS.
EDIT: Later on I found this similar question (with a slight variation) in SU.
Examples
This is what I see with a couple of commands
> dir
****** EXTRA LINE
****** EXTRA LINE
Directorio: C:\Users\USER1\OneDrive - YPF\Documents\soft-hard-ware\windows\powershell ****** VERBOSITY LINE
****** EXTRA LINE
****** EXTRA LINE
Mode LastWriteTime Length Name ****** VERBOSITY LINE
---- ------------- ------ ---- ****** VERBOSITY LINE
-a---- 9/7/2020 17:11 1021 exec_powershell_info.txt
-a---- 9/4/2016 08:25 281 first_bytes.ps1
-a---- 10/7/2020 07:53 1536 get_current_script_name.ps1
-a---- 9/7/2020 11:58 29 hello_world.ps1
-a---- 9/4/2016 09:02 344 last_bytes.ps1
-a---- 14/4/2016 13:08 975 split.ps1
-a---- 10/7/2020 07:54 3108 update-help.txt
****** EXTRA LINE
****** EXTRA LINE
> Get-Culture
****** EXTRA LINE
LCID Name DisplayName ****** VERBOSITY LINE
---- ---- ----------- ****** VERBOSITY LINE
11274 es-AR Español (Argentina)
****** EXTRA LINE
****** EXTRA LINE
Scrolling to the right, one can see my comments.
I have tagged "EXTRA LINE
" the lines I mean to remove.
I have tagged "VERBOSITY LINE
" the lines I mean to remove, but which I sort of "tolerate" more.
As a point in comparison, this is what I see in Linux, which I find "less verbose".
$ ll
total 12K
drwxrwxr-x 2 santiago santiago 4,0K ago 10 2017 ./
drwxrwxr-x 17 santiago santiago 4,0K may 19 10:28 ../
-rwxrwxr-x 1 santiago santiago 557 ago 10 2017 date2str.rb*
List of other sources that do not address the issue
- Remove blank lines in powershell output
- Remove blank lines Powershell output
- Removing Blank Lines From Powershell Output
- How to remove extra lines from Get-WMIObject output powershell
- Remove blank lines from output?
- Remove Blank Space From Output in PowerShell
- Remove Empty Lines From Powershell Output
- Removing extra blank space from PowerShell output
- Remove blank lines from the output
- https://social.technet.microsoft.com/Forums/en-US/229727f6-fdb6-4d95-b585-bd9af3ee6670/removing-blank-spaces-and-blank-lines-from-output?forum=ITCG