$info = Invoke-SQLCmd -ServerInstance $Server -Database $Database -inputfile "$queriespath/compare_quantity.sql"
$changes = $info.length
for($i=0; $i-le$changes; $i++) {
$text = "Revise,$info[$i].quantity,$info[$i].itemid" | Set-Content 'C:\Users\pmaho\Dropbox\SAMPOWERSPORTS\CustomChrome\revision.txt'
}
I'm trying to write the value of $info[$i].quantity,$info[$i].itemid to the file.
This is what my code outputs now Revise,System.Data.DataRow System.Data.DataRow[2].quantity,System.Data.DataRow System.Data.DataRow[2].itemid
I want it to say the actual value of the varables how can I do this?
EDIT:
for($i=0; $i-le$changes; $i++) {
$text = $($info[$i].quantity) | Set-Content 'C:\Users\pmaho\Dropbox\SAMPOWERSPORTS\CustomChrome\revision.txt'
}
The above is printing nothing.