I'm using Invoke-SqlCmd to get a DataTable result. Is there a way to get the max value of the ID column in the DataTable in PowerShell?
$sqlResult = Invoke-Sqlcmd -Query 'select * from customer' -ServerInstance '(localdb)\MSSQLLocalDB' -Database 'Database1' -OutputAs DataTables
$sqlResult.GetType()
$sqlResult | Out-Host
