< Back
Assert-DirectoryExists
Post
NAME Assert-DirectoryExists
SYNOPSIS
Asserts that a directory exists.
SYNTAX
Assert-DirectoryExists [[-Path] <String>] [[-Message] <String>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `Test-Path` cmdlet to check if a directory exists.
PARAMETERS
-Path <String>
The path to the directory to check.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
A description of why the assertion might fail.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-DirectoryExists 'C:\\Windows'
Demonstrates how to assert that a directory exists.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-DirectoryExists 'C:\\Foobar' 'Foobar wasn''t created.'
Demonstrates how to describe why an assertion might fail.
RELATED LINKS
SYNOPSIS
Asserts that a directory exists.
SYNTAX
Assert-DirectoryExists [[-Path] <String>] [[-Message] <String>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `Test-Path` cmdlet to check if a directory exists.
PARAMETERS
-Path <String>
The path to the directory to check.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
A description of why the assertion might fail.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-DirectoryExists 'C:\\Windows'
Demonstrates how to assert that a directory exists.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-DirectoryExists 'C:\\Foobar' 'Foobar wasn''t created.'
Demonstrates how to describe why an assertion might fail.
RELATED LINKS