I want to put a counted value from a sql query into a variable of powershell...? If i run the following command:
sqlcmd -S "ms-sql-1264" -d "ShellPlus" -q "SET ANSI_WARNINGS OFF; SET NOCOUNT ON; SELECT COUNT(InternalMeasurementID) as number_of_running_measurements FROM [ShellPlus].[dbo].[Measurements] WHERE Archived = 0 AND ClinicalInfo NOT LIKE '%PSG%' AND Classification NOT LIKE '%TEST' AND Classification NOT LIKE '%RESEARCH%' AND Status = 2"
I get the result:
PS H:\> C:\install\powershell scripts\mail sturen lopend EEG\test_sql.ps1
number_of_running_measurements ------------------------------ 0
but the program won't stop...?
And i want to create an if statement with the value "number of running measurements"
Anyone?
Best regards, Thijs