Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

PowerTip: Capture Console Application Data with PowerShell

$
0
0

Summary: Use Windows PowerShell to capture console application data.

Hey, Scripting Guy! Question How can I parse the output from a console application by using Windows PowerShell?

Hey, Scripting Guy! AnswerRun the application as normal, but assign it to a Windows PowerShell object—for example,
         DriverQuery.exe will display output to the screen:

$INFO=(DriverQuery.exe)

This creates an array that you can pipe to Get-Member to discover available methods or to access individual lines:

$INFO[3]

$INFO[-1].substring(4,7)


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>