Powershell access a single value in a table
- by falkaholic
this should be a really easy one but i can't seem to find an easy way.
For example, in powershell and am using a CSV file, which is then used to look up some configuration data based on an ID. Here is what I have now, it works, but there has got to be a better way.
$configList = import-csv "C:\myconfig.csv"
$id = "5001"
$configList | where-object {$_.id -eq $id} | foreach-object{ $configData = $_.configData}
If use format-table etc, I always get the column header, which I would then have to cut off.
Again, this has got to be really easy and this isn't a show stopper. But there has to be a better way to get just the data out of a table without the column header.