Repository navigation
Why does Get-ChildItem arbitrarily limit its width?
#20322
#!/usr/bin/env -S pwsh -File
#Requires -PSEdition Core
Get-ChildItem "$Home/.local/share/Steam/steamapps/common/Terraria/Content/Images/Backgrounds/"…outputs:
There's no reason for it to wrap my username, considering that PS /home/beedell.roke_julian_lockhart> Get-ChildItem "$Home/.local/share/Steam/steamapps/common/Terraria/Content/Images/Backgrounds/" | Format-Table -AutoSize
Directory: /home/beedell.roke_julian_lockhart/.local/share/Steam/steamapps/common/Terraria/Content/Images/Backgrounds
UnixMode User Group LastWriteTime Size Name
-------- ---- ----- ------------- ---- ----
drwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:53 728 Ambience
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 19686 Underworld 0.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 128722 Underworld 1.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 60522 Underworld 10.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 76996 Underworld 11.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:53 27574 Underworld 12.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 68836 Underworld 13.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 15900 Underworld 2.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 6812 Underworld 3.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 894 Underworld 4.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 12270 Underworld 5.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:53 109208 Underworld 6.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 55416 Underworld 7.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:52 41298 Underworld 8.xnb
-rwxr-xr-x beedell.roke_julian_lockhart beedell.roke_julian_lockhart 27/09/2026 10:53 5606 Underworld 9.xnbFootnotes |
Replies: 3 comments 7 replies
|
The wrapping in your example comes from the default table view, rather than the username being truncated in the underlying object. In the 7.4.0-preview.3 view definition, Choose the columns explicitly and let PowerShell size them from their values: Get-ChildItem -LiteralPath '/path/to/Backgrounds' |
Format-Table User, Group, Name -AutoSizeAdd If you want to inspect the values independently of the default table, use: Get-ChildItem -LiteralPath '/path/to/Backgrounds' |
Format-List User, Group, NameThis also explains why |
I do not remember this is by default or not:
|
|
You can use numerical UID/GID: $ dir -af -ah
Directory: ~
UnixMode Num UID GID LastWriteTime Size Name
-------- --- --- --- ------------- ---- ----
-rw------- 600 1000 1000 11/7/2026 10:27 AM 8.4K .bash_history
-rw-r--r-- 644 1000 1000 5/21/2023 2:56 PM 21 .bash_logout
-rw-r--r-- 644 1000 1000 5/21/2023 2:56 PM 57 .bash_profile
-rw------- 600 1000 1000 10/20/2026 1:46 PM 3.9K .bashrc
-rw-r--r-- 644 1000 1000 5/3/2025 9:16 AM 21 .dmrc
-rwxr-xr-- 754 1000 1000 11/6/2026 5:14 PM 94 .fehbg
-rw-r--r-- 644 1000 1000 11/5/2026 10:47 AM 597 .gtkrc-2.0
-rw------- 600 1000 1000 3/1/2025 9:11 AM 0 .ICEauthority
-rw------- 600 1000 1000 11/7/2026 10:22 AM 479 .profile
-rw------- 600 1000 1000 1/9/2026 10:40 AM 1024 .rnd
-rw------- 600 1000 1000 10/31/2026 9:37 PM 1K .sqlite_history
-rw------- 600 1000 1000 5/4/2025 1:43 PM 0 .Xauthority
-rw-r--r-- 644 1000 1000 4/12/2023 8:46 AM 214 .xinitrc
-rw------- 600 1000 1000 8/22/2026 4:45 PM 102 .xprofile
-rw-r--r-- 644 1000 1000 11/5/2026 10:47 AM 65 .Xresources
-rw-r--r-- 644 1000 1000 4/12/2023 8:46 AM 63 .xsession
-rw-r--r-- 644 1000 1000 4/12/2023 8:46 AM 212 .xsessionrc
|
Because -AutoSize has to collect all the output first to know what the widest content is, and that can slow down the display. You can compare these 2 examples:
ls C:\ | foreach {Start-Sleep -Milliseconds 200; $_}VSls C:\ | foreach {Start-Sleep -Milliseconds 200; $_} | ft -AutoSizethe first one streams the content slowly, while the other waits for all items to be collected before showing them.