Is there a PowerShell equivalent to the dir /w of the old Windows command prompt?

314 Views Asked by At

In the older Windows command prompt dir /w formatted the directory output in wide format, providing a more at-a-glance view of contents to pick out folder names without having to scroll through the larger output that happens when they are all stacked vertically. This is especially useful when in VS Codes integrated terminal where the terminal window size is often restricted. Does PowerShell have an equivilent?

3

There are 3 best solutions below

0
Darren Evans On BEST ANSWER

This final, and my preferred, solution involves creating a function in my Powershell profile:

function List-Wide
{
    Get-ChildItem | Format-Wide -Column 5
}

Then, further down in my profile script, setting an alias to call this function:

Set-Alias -Name lsw -Value List-Wide
6
Minkulai On

are you after this?

Get-ChildItem | Select-Object -Property Name

It should be an equivalent of "dir /w". If I remember correctly.

0
Darren Evans On

cmd /r dir /w as suggested by DSSO21 in the Comments above gives me the result I was expecting, albeit a more verbose command than I'd like.