powershell run sql server stored procedure code example
Example: execute sql stored procedure in powershell
$rrex = Invoke-Sqlcmd -ServerInstance "OurServer" -Database "OurDatabase" -Query "EXEC stpGetData"
foreach ($rrec in $rrex)
{
if ($rrec.IdVar -notmatch "V-[1-8]{1}")
{
$rrec.Id
}
}