I should execute remotely SQL command on database because sqlcmd
is not installed.
$Configuration = Invoke-Command -ComputerName $dataserverName -Credential $cred -ScriptBlock {
sqlcmd.exe -S $using:dataserver -U $using:user -P $using:pass -d $using:database -q $using:SQLQuery
}
So when I execute my request, I got the response in the same block so I can not get value from each column like this:
MinimumSize MaximumSize Delimiter IdFile -------------------- -------------------- --------- ---------------------- NULL NULL | 6 (1 rows affected)
so if I do $Configuration[0]
, I got
$Configuration[0] = MinimumSize MaximumSize Delimiter IdFile
like a line, so I can not do anything.
My question is how to get for example $Configuration.IdFile = 6
.