```
If ($file.Contains(" $hostname") -or $file.Contains("`t$hostname"))
```
cannot detect already existing entries if the case does not match.
Quick Suggestion:
```
If (($file -match " $hostname") -or ($file -match "`t$hostname"))
```
If ($file.Contains(" $hostname") -or $file.Contains("`t$hostname"))
```
cannot detect already existing entries if the case does not match.
Quick Suggestion:
```
If (($file -match " $hostname") -or ($file -match "`t$hostname"))
```