I'm trying to read a config file, then set a numerical status based on the value of a key. The problem is this returns 0 every time. The value of SiteDown is either blank, or contains a web URL (IE; www.google.com). Any insight is appreciated!
[xml]$config = invoke-command ${Node.DNS} { get-content C:\scripts\WebApp.config }
$SiteDown = $config.SelectNodes('//add[@key="SiteDown"]/@value'
$value = $SiteDown.Value
if ($value -like "*google.com") { $status = 1 } else { $status = 0 }
write-host "Statistic: $status"