I have a pretty basic PowerShell array: $TestArray with 2 text columns: Price and TimeStamp (that's the way I get them, nothing to be done about this):
Price TimeStamp
----- ----------------
0.0567 1542056680.72746
0.0567 1542056650.34414
0.0555 1542056197.46668
0.0551 1542056167.28967
I would like, in a single PowerShell line to add a rounded Time2 value
$Time2 = [math]::Round($TestArray.TimeStamp)
The code I am thinking of is:
$TestArray | Add-Member -Name Time2 -MemberType NoteProperty -Value { [math]::Round($Table.TimeStamp) }
Of course, I can do a ForEach loop; it would take care of it easily, but I would like to achieve this in this single line of code.
Any idea ?
Cheers, Philippe