windows show command process in command line and write to file code example Example: how to count number of running processes in windows open in power shell: (Get-Process).Count