Invoke-VolumeOptimization
Description
This command will utilize the Optimize-Volume command to defragment or trim a drive if it is compatible. If the drive is not compatible, the standard defrag method will be used.
Usage
- Determine the scope of drives to defragment.
- For each drive, log a baseline of an analysis scan (works for compatible and non-compatible drives).
- Defragment the drive if it is compatible with Optimize-Volume; if not, call the standard defrag method.
- Log the results of the defragmentation.
.\Invoke-VolumeOptimization.ps1
This command will attempt a defragmentation of all drives.
.\Invoke-VolumeOptimization.ps1 -Drives C,E
This command will defragment drives C and E.
Parameters
Parameter | Alias | Required | Default | Type | Description |
---|---|---|---|---|---|
Drives | False | all drives | String[] | The drives you wish to scan. If left blank, defaults to all drives. |
Output
The location of output for log, result, and error files:
.\Invoke-VolumeOptimization-log.txt
Notes
This script may take more than 30 minutes to complete.