Qlik Community

QlikView Documents

Documents for QlikView related information.

Listing top folders of your server

Employee
Employee

Listing top folders of your server

It´s a regular task administering a QlikView server checking top "N" folders in size.

I´ve adapted this script from here.

It is written in Powershell, I´m almost sure your server has it installed

#Configure your main folder and how many folders you want beloe

$path ="D:\QvHome"

$top = 10

Function Get-FolderSize

{

  BEGIN{

  $fso = New-Object -comobject Scripting.FileSystemObject

  }

  PROCESS{

  $path = $input.fullname

  $folder = $fso.GetFolder($path)

  $size = $folder.size

  [PSCustomObject]@{‘Name’ = $path;’Size’ = [convert]::ToInt32(($size / 1mb)) }

  }

}

Get-ChildItem $path -Directory -Recurse -ErrorAction SilentlyContinue  | Get-FolderSize | sort size -Descending | select-object -first $top

Comments
santiago_respane
Valued Contributor

Great contribution! i was doing this via batch and working good but your solution with powershell looks really nice and neat and with less code.

Thanks a lot!

Version history
Revision #:
1 of 1
Last update:
‎08-04-2016 10:50 AM
Updated by:
Employee