Forum Discussion

Sandeepkv3003's avatar
Sandeepkv3003
Copper Contributor
Oct 05, 2021

How to get filesize in a folder with single command?

I am relatively new to Powershell and trying to get to hands on experience of learning it. I am trying to list all files and folders but with their size in MBs. I tried multiple things, but unable to...
  • gastone's avatar
    Oct 07, 2021

    Something like this

    dir | ft -Property mode,lastwritetime, @{Name="Size MB";Expression={$_.Length / 1mb}; format = '0.0'},name

     

Resources