Asserts that a directory exists.
Assert-DirectoryExists [[-Path] <String>] [[-Message] <String>] [<CommonParameters>]
Uses PowerShell's Test-Path
cmdlet to check if a directory exists.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path | String | The path to the directory to check. |
false | false | |
Message | String | A description of why the assertion might fail. |
false | false |
Assert-DirectoryExists 'C:\Windows'
Demonstrates how to assert that a directory exists.
Assert-DirectoryExists 'C:\Foobar' 'Foobar wasn''t created.'
Demonstrates how to describe why an assertion might fail.