< Back

Assert-DirectoryDoesNotExist

Sun Jan 12, 2020 5:34 pm

NAME Assert-DirectoryDoesNotExist



SYNOPSIS

Asserts that a directory doesn't exist.





SYNTAX

Assert-DirectoryDoesNotExist [[-Path] <String>] [[-Message] <String>] [<CommonParameters>]





DESCRIPTION

Uses PowerShell's `Test-Path` cmdlet to check if a directory doesn't exist.





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 doesn't exist.









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



PS C:\\>Assert-DirectoryExists 'C:\\Foobar' 'Foobar wasn''t removed.'



Demonstrates how to describe why an assertion might fail.











RELATED LINKS