Assert-NotEqual

Asserts that two objects aren't equal.

Syntax

Assert-NotEqual [[-Expected] <Object>] [[-Actual] <Object>] [[-Message] <Object>] [<CommonParameters>]

Description

Uses PowerShell's -eq operator to determine if the two objects are equal or not.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Expected Object

The expected value.

false false
Actual Object

The actual value.

false false
Message Object

A descriptive error about why the assertion might fail.

false false

EXAMPLE 1

Assert-NotEqual 'Foo' 'Foo'

Demonstrates how to assert that 'Foo' -eq 'Foo', which they are.

EXAMPLE 2

Assert-NotEqual 'Foo' 'Bar' 'Didn''t get ''Bar'' result.'

Demonstrates how to show a reason why a test might have failed.