Skip to main content

Get-FreeDiskSpace

SYNOPSISโ€‹

Retrieves the free disk space in MB on a particular drive (defaults to system drive)

SYNTAXโ€‹

Get-FreeDiskSpace [[-Drive] <String>] [[-ContinueOnError] <Boolean>] [<CommonParameters>]

DESCRIPTIONโ€‹

Retrieves the free disk space in MB on a particular drive (defaults to system drive)

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Get-FreeDiskSpace -Drive 'C:'

PARAMETERSโ€‹

-Driveโ€‹

Drive to check free disk space on

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: $envSystemDrive
Accept pipeline input: False
Accept wildcard characters: False

-ContinueOnErrorโ€‹

Continue if an error is encountered. Default is: $true.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

System.Doubleโ€‹

Returns the free disk space in MBโ€‹

NOTESโ€‹

https://psappdeploytoolkit.com