Skip to content

Function Volume

Mark Wragg edited this page Jun 17, 2019 · 1 revision

Volume

SYNOPSIS

Test the specified setting of a volume.

DESCRIPTION

Uses the Get-Volume cmdlet to validate the specified setting of a volume by either DriverLetter or FileSystemLabel property.

PARAMETERS

Target [String]

Specifies the drive letter or file system label of the volume to test.

[Parameter(Mandatory, Position=1,ParameterSetName="Default")]
[Parameter(Mandatory, Position=1,ParameterSetName="Property")]
[Alias('Name')]

Property [String]

Specifies an optional property to test for on the volume.

[Parameter(Position=2,ParameterSetName="Property")]
[ValidateSet(
    'AllocationUnitSize',
    'DedupMode',
    'DriveLetter',
    'DriveType',
    'FileSystem',
    'FileSystemLabel',
    'FileSystemType',
    'HealthStatus',
    'ObjectId',
    'OperationalStatus',
    'Path',
    'Size',
    'SizeRemaining'
)]

Should [ScriptBlock]

A Script Block defining a Pester Assertion.

[Parameter(Mandatory, Position=2)]

Assertions

Assertions: -Be

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

Volume C HealthStatus { Should -Be 'Healthy' }

-------------------------- EXAMPLE 2 --------------------------

Volume C FileSystem { Should -Be 'NTFS' }

-------------------------- EXAMPLE 3 --------------------------

Volume D AllocationUnitSize { Should -Be 64K }

-------------------------- EXAMPLE 4 --------------------------

Volume MyFileSystemLabel SizeRemaining { Should -BeGreaterThan 1GB }