I am importing a .csv into a variable $user. I can then access each field using $user.ARN (for example). This works fine.
But then I need to build a string using this variable.
$SQLQuery = "USE Cardpresso INSERT INTO dbo.students (Name, ARN, CardNumber, isPrinted) VALUES('$DisplayName', $User.ARN , $CardNumber, 0);"
When I check what is inside the $SQLQuery variable, it holds the whole csv row inplace of $User.ARN.
USE Cardpresso INSERT INTO dbo.students (Name, ARN, CardNumber, isPrinted) VALUES('%%% %%%', @{FirstName=%%%; LastName=%%%; ARN=%%%; Group=%%%; Email=unknown@unknow.com; Pass=%%%; Site=%%%; CardNumber=}.ARN , 508, 0);
(The %%% are real data, just removed)
Why is the $User.ARN not just been replaced with the data from just that field, instead it is inputting the whole row?
Thanks