Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > Utilities Suggestions
  New Posts New Posts RSS Feed - CSV output for easier PowerShell scripting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CSV output for easier PowerShell scripting

 Post Reply Post Reply
Author
Message
r_keith_hill View Drop Down
Newbie
Newbie


Joined: 08 November 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote r_keith_hill Quote  Post ReplyReply Direct Link To This Post Topic: CSV output for easier PowerShell scripting
    Posted: 06 April 2012 at 6:21am



PowerShell has this great facility for manipulating objects.  Whenever we need to script the output of a SysInternals utility we have to parse text which is brittle and ugly code.  Rather than do this:
 
$openFiles = @(handle $env:TEMP | Foreach {($_ -split ": ")[3]} | Select -Unique)
 
I'd love to be able to do this:
 
$openFiles = @(handle $env:TEMP -fo CSV | Import-Csv |Select Path -Unique)



Edited by r_keith_hill - 06 April 2012 at 7:24am
Back to Top
cliffburger View Drop Down
Newbie
Newbie


Joined: 06 April 2012
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote cliffburger Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2012 at 7:07am
+1
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down