506528 (1) [Avatar] Offline

In chapter 10, page 132 in the Above and Beyond section it suggests to enter:
Get-Process |
Format-Table Name,
@{name='VM(MB)';expression={$_.VM / 1 MB -as [int]}} -autosize

It says that after you hit enter on the first line Powershell changes its prompt and waits for more commands, however I can't get past that first line, it just throws an error saying 'An empty pipe element is not allowed'. How do I resolve this? It would be very nice to be able to enter commands over multiple lines rather than sometimes super duper long one-line commands
502470 (1) [Avatar] Offline
Hi there

I've just come across this myself - it appears that this will only work in the standard Powershell window - if you're using the Powershell ISE window (which is, ironically, pushed and recommended all the way through the book!) it will fail with the Empty Pipe error.

According to some Stack Overflow research, the reason is apparently: "Powershell ISE ( integrated scripting environment ) is not the standard Powershell console. The ISE, like the name suggests, is a pretty basic GUI based script writing tool and doesn't support interactive console applications"

I hope that helps!