Error:
Unexpected token 'in' in expression or statement.At :line:1 char:22
+ ForEach-Object ($i in <<<< $fs_size_info) { $i.Name.Name, GetGB($i.Sum) }
Code:
foreach ($i in $fs_size_info) { $i.Name.Name GetGB($i.Sum) }If I omit the function from inside this foreach, it works perfectly, and I can access $i.Sum within the foreach as well. The problem arises when I try to call a function from inside the foreach. GetGB simply returns a more readable format e.g. GetGB(1024) will return "1 K" etc...
I don't understand what I'm doing wrong, unless you cannot call a function inside a foreach statement.... am I missing something?
Thanks