Assert-LastError

OBSOLETE. Use Assert-Error instead.

Syntax

Assert-LastError [-ExpectedError] <String> [[-Message] <String>] [<CommonParameters>]

Description

OBSOLETE. Use Assert-Error instead.

Parameters

Name Type Description Required? Pipeline Input Default Value
ExpectedError String

The expected error message for the last error.

true false
Message String

A custom message to show when the assertion fails.

false false

EXAMPLE 1

Assert-Error -Last 'not found'

Demonstrates how to use Assert-Error instead.