iI should execute remotely SQL command on dataBasedatabase because sqlsqlcmd
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 iI execute my request, iI got the response in the same block so iI can not get value from each column like this :
MinimumSize MaximumSize Delimiter IdFile
NULL NULL | 6
MinimumSize MaximumSize Delimiter IdFile
-------------------- -------------------- --------- ----------------------
NULL NULL | 6
(1 rows affected)
(1 rows affected)
so if iI do $Configuration[0] $Configuration[0]
, iI got
$Configuration[0] = MinimumSize MaximumSize Delimiter IdFile
like a line, so iI can not do anything. My question is how to get for example $Configuration.IdFile = 6
thanks in advance$Configuration.IdFile = 6
.