I am running an sql query that will save the result into a csv. The only thing in the csv is the return of a COUNT() function. Is there a way that I can save this number directly into a variable in powershell?
Should be simple. Let's assume the CSV field is called Result
:
$result = (Import-Csv .\sqlout.csv).Result