Public/Compare-CrmSolutionComponent.ps1

Function Compare-CrmSolutionComponent {
    <#
        .SYNOPSIS
        # Gets a list of components unique to ReferenceComponent.
 
        .DESCRIPTION
        # Gets a list of components unique to ReferenceComponent. Compares only on the ObjectId and RootComponentBehavior
        # properties.
 
        .OUTPUTS
        # Array containing objects of type SolutionComponent. Objects include SideIndicator properties added by Compare-Object
    #>

    [cmdletbinding()]
    Param
    (
        [SolutionComponent[]]$ReferenceComponent,
        [SolutionComponent[]]$DifferenceComponent
    )

    if ($DifferenceComponent.ComponentType -eq 1) {
        $relativeComplement = Compare-Object -ReferenceObject $ReferenceComponent -DifferenceObject $DifferenceComponent -Property ObjectId, RootComponentBehavior -PassThru | Where-Object SideIndicator -eq '<='
    }
        
    Write-Output $relativeComplement    
}