What can I use for the PowerShell notin operator in v2.0? I developed a PowerShell script in v4.0 and then learned that the -notin operator isn't supported on v2.0 (which is the version that I need to run it in). What is the best alternative to the -notin operator for v2.0? I'd prefer to minimize code refactoring, if possible.

Here is a snippet of code where I am using the operator:

$NoBackups += $BackupList | 
            Where-Object { $_.DatabaseName -notin ($NoBackups.DatabaseName) } |
            Where-Object { ($_.RecoveryModel.ToString().ToUpper() -ne "SIMPLE") -and ($_.LastLogBackupDate -lt $CompareDate.AddHours($LOGCompareHours)) } |
            SELECT InstanceName, DatabaseName, LastBackupDate, LastDifferentialBackupDate, LastLogBackupDate, `
                @{Name='Message';Expression={"Transaction Log Backup is more than $([Math]::Abs($LOGCompareHours)) hours old"}}
You can use -NotContains in PowerShell v2.0 and up. The only thing you will need to do is just reverse your check. Using -NotIn you are comparing your current value to the collection, with -NotContains you do the reverse by comparing your collection to your current value.

So just change this:

Where-Object { $_.DatabaseName -notin ($NoBackups.DatabaseName) }


To 

Where-Object { $NoBackups.DatabaseName -NotContains $_.DatabaseName }


A rough example: