Asserts that a file does not exist.
Assert-FileDoesNotExist [[-Path] <String>] [[-Message] <String>] [<CommonParameters>]
Uses PowerShell's Test-Path
cmdlet to check if a file doesn't exist.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path | String | The path to the file to check. |
false | false | |
Message | String | A description of why the assertion might fail. |
false | false |
Assert-FileDoesNotExist 'C:\foobar.txt'
Demonstrates how to assert that a does not exist.
Assert-FileDoesNotExist 'C:\foobar.txt' 'foobar.txt not removed.'
Demonstrates how to describe why an assertion might fail.