I can't figure out how to get the results of the query (qty_records) which is 5 so I can use it in a PowerShell If statement.
====
$my_query = "select count(CustomerNumber) as qty_records from customers"
$qty_records = Invoke-Sqlcmd -Query $my_query -ServerInstance "2008c" -Username sa -Password abc.1234 -Database MikeDB
if ($qty_records -gt 4) {
write-host "do something"
} else {
Write-Host "do something else"
}
====== thanks