# $cs.Sys_IsMinimumRequiredDiskspaceAvailable

> Checks whether the specified drive has more free space than a required minimum.

Source: https://docs.capaone.com/capainstaller/powerpacks/cs-sys-isminimumrequireddiskspaceavailable/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Checks whether the specified drive has more free space than a required minimum. Note the comparison is strictly greater than — if free space is exactly equal to `minimumdiskspaceinmb`, this returns `$false`. This also updates an internal "sufficient disk space" status flag used elsewhere for job reporting.

### Syntax

$cs.Sys_IsMinimumRequiredDiskspaceAvailable(string drive = "C:", double minimumdiskspaceinmb = 100)

### Parameters

#### drive (String)

Drive to check free disk space on. Defaults to `"C:"`.

#### minimumdiskspaceinmb (Double)

Minimum required free disk space, in MB, that must be exceeded. Defaults to `100`.

### Return value

Boolean. `$true` if free disk space on the drive is strictly greater than `minimumdiskspaceinmb`, otherwise `$false`.

### Example

**PowerShell**

The standard PreInstall guard, using the job's configured minimum disk space on the system drive:

```powershell
if (!$cs.Sys_IsMinimumRequiredDiskspaceAvailable($global:gsSysDrive, $global:MinimumDiskspaceMB)) { throw "Minimum required disk space not available" }
```

Check a separate data drive that a large software kit will be extracted to, with a custom threshold:

```powershell
if (!$cs.Sys_IsMinimumRequiredDiskspaceAvailable("D:", 5000))
{
  throw "At least 5 GB free space is required on D: to extract the installation kit"
}
$cs.Job_WriteLog("Sufficient disk space confirmed on D:, extracting kit")
```

### Related functions

[$cs.Sys_GetFreeDiskSpace](/capainstaller/powerpacks/cs-sys-getfreediskspace/)
