Reputation: 13206
How would I pipe the information I've pulled out from a spreadsheet into a Powershell object?
$rangeAddr=$startCell + ":" + $endCell
$sh.Range($rangeAddr).Value2 | foreach {
New-Object PSObject -Property @{"Build"=$sh.Name;"AppName"=$_;}
}
Upvotes: 0
Views: 135
Reputation: 68273
I believe creating objects from hash tables was in V2, but not V1.
Does this work?
$rangeAddr=$startCell + ":" + $endCell
$sh.Range($rangeAddr).Value2 |
foreach {
$NewObject = "" | Select Build,Name
$Newobject.Build = $sh.Name
$NewObject.Name = $_
$NewObject
}
Upvotes: 2