PoshCode Archive  Artifact [f822dfa67d]

Artifact f822dfa67d09fb4802c05407309f10ae63fefc2d02e2c6e557b503aef9b61f5b:

  • File Get-FolderSize.ps1 — part of check-in [a1836d8f89] at 2018-06-10 13:58:27 on branch trunk — A Little Script for $PROFILE File to Add Support for Get-FolderSize. (user: Piere Woehl size: 646)

# encoding: ascii
# api: powershell
# title: Get-FolderSize
# description: A Little Script for $PROFILE File to Add Support for Get-FolderSize.
# version: 0.1
# type: function
# author: Piere Woehl
# license: CC0
# function: Get-FolderSize
# x-poshcode-id: 5647
# x-archived: 2016-09-07T04:24:22
# x-published: 2016-12-15T19:54:00
#
# Show in MB and 2 Digits behind “.”
#
function Get-FolderSize {
$location = $args[0]
Write-Host "Directory to Scan:"$location
$value = "{0:N2}" -f ((Get-ChildItem -recurse $location | Measure-Object -property length -sum).Sum / 1MB)
Write-Host "Used Storage for Directory:"$value" MB"
}