Q:

Conditionally change boolean variable in an imported CSV

I am working on a script and I want to compare an array to another array, and change a boolean value (from $false to $true) based on a result.  This works fine on strings using the Replace method, but that doesn't exist for boolean values.  Can anyone tell me how to do this?
$bv is an array of objects, as follows.
ServerName,Domain,Environment,Tier0
ServerA,usa,dev,$false
ServerB,usa,sit,$false

I am trying to compare that list to another list of Tier0 computers ($t0List) that looks like this.
ServerB
ServerC
ServerD
So if there is a match between the ServerName in column 1 of $bv and an entry in $t0List, then I want to change the Tier0 column in $bv to $true.
foreach ($b in $bv) {
if ($t0List -contains $b.ServerName) {
    $b.Tier0.Replace($b.Tier0,$true)
    }
}

The error I get with the above code is...
Method invocation failed because [System.Boolean] does not contain a method named 'Replace'.

A:

There's no need to use something like replace, just assign the value with =:
foreach ($b in $bv) {
    if ($t0List -contains $b.ServerName) {
        $b.Tier0 = $true
    }
}

Want to simplify it even more? Just assign it the result of your -contains:
foreach ($b in $bv) {
    $b.Tier0 = $t0List -contains $b.ServerName
}

