Skip to content

Invoke-ObjectComparison

SYNOPSIS

Invokes an comparison between two sets of objects.

SYNTAX

1
2
Invoke-ObjectComparison [-ReferenceObject] <ArrayList> [-DifferenceObject] <ArrayList>
 -CompareSettings <PSObject> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Invoke-ObjectComparison function acts a wrapper to the Compare-Object cmdlet and returns objects based on what settings have been provided to the CompareSettings parameter.

Basic logic implemented:

If SideIndicator -eq '=>' and ExcludeDifferent -ne 'true' we add a property called disable with the value of $false and return the object. If SideIndicator -eq '==' and IncludeEqual -eq 'true' we add a property called disable with the value of $false and return the object. If SideIndicator -eq '\<=' we add a property called disable with the value of $true and return the object.

EXAMPLES

EXAMPLE 1

1
2
3
$sourceObjects = Invoke-JdbcHandler -SourceDirectory $srcDirectory -ImportClientConfiguration $icConfig -ConfigurationSourceSettings $source
$referenceObjects = Get-EasitGOItem @getReferenceObjectsParams
$compareResult += Invoke-ObjectComparison -ReferenceObject $referenceObjects -DifferenceObject $sourceObjects -CompareSettings $source.compare

PARAMETERS

-CompareSettings

Compare settings object from configuration JSON file.

1
2
3
4
5
6
7
8
9
Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DifferenceObject

Specifies the objects that are compared to the reference objects.

1
2
3
4
5
6
7
8
9
Type: ArrayList
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.

The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.

1
2
3
4
5
6
7
8
9
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ReferenceObject

Specifies an array of objects used as a reference for comparison.

1
2
3
4
5
6
7
8
9
Type: ArrayList
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Collections.ArrayList

PSCustomObject

OUTPUTS

PSCustomObject

NOTES