Because I spend a great part of my day creating PowerShell related content, I often need to copy command output from a PowerShell session. The quick and dirty solution is to pipe my expression to the Clip.exe command line utility. get-service | where { $_.status -eq ‘running’} | clip This works in both the console…
Tag: Tee-Object
Have Your Output and Variable Too
There’s a relatively useful suggestion floating around on Twitter on how to save results of PowerShell command to a variable and see the results at the same time. PS C:\> ($data=get-process) I’ll admit this is a clever technique: you get the results from Get-Process written to the pipeline AND a variable $data. The other way,…
Friday Fun: Output to 2 Places in 1
Today’s Friday Fun comes out of a short exchange I had yesterday with Hal Rottenberg on Google Plus. We were playing around with piping a PowerShell command to Clip.exe which dumps the output to the Windows Clipboard. I got to thinking about taking this a step further based on my needs as a writer. Often…