Forum Discussion

MichaelNazli's avatar
MichaelNazli
Copper Contributor
May 30, 2020

Trying to create a table via Powershell

Hi Guys, I do have bunch of target folders that I'm trying to check them regularly via PS script;   RootFolder\AAAA0001\Apps\... RootFolder\BBBB0001\Apps\... RootFolder\CCC00001\Apps\... RootFol...
  • gastone's avatar
    Jun 28, 2020

     

     

    dir c:\RootFolder -dir |
       ft name,@{Label=”AppFolderSize(GB)”;Expression= {“{0:n2} GB” -f ((dir -rec $_|measure length -sum -ErrorAction SilentlyContinue).sum /1gb)}}

     

    MichaelNazli  the script above is a single line of code and the output will be something like this:

     

    Name            AppFolderSize(GB)
    ----            -----------------
    kkk             0,00 GB          
    m               2,54 GB          
    office2019-last 1,88 GB          
    symbols         0,00 GB          
    up2             0,00 GB          
    uplanner        0,00 GB     

     

     

    bye Gas

Resources