March 22nd, 2014

PowerTip: Convert Output to Use Specific Delimiter

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to convert output to a specific delimiter.

Hey, Scripting Guy! Question How can I use Windows PowerShell to select process name and paged system memory, plus separate the output with a colon?

Hey, Scripting Guy! Answer Use the Get-Process cmdlet to retrieve the process information, select the name,
          add the PagedSystemMemorySize property, pipe the output to the ConvertTo-CSV cmdlet,
          and specify the delimiter as “:”:

Get-Process | select name, PagedSystemMemorySize | ConvertTo-Csv -Delimiter ":"

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.