How can I measure memory usage of a command in powershell. I'm thinking something like "Maximum resident memory" GNU time returns with -v flag. Measure-Command only measures time.
I also found this in my searches https://communary.net/2014/10/28/measure-scriptblock/ but its method for measuring memory use is clearly broken. It ouputs 0 kB for programs that definitely use a few megabytes.
My experience of shell scripting is mostly with bash, unfortunately. I found a few solutions that output the momentary memory use of a process using powershell. I tried using Start-Job, but running my same command inside Start-Job seems to kill it right away (It's an exe in the local directory). And anyway, I'm interested in total memory use by the process, not the momentary use at a point in time.