posts-powershell

Who Is Listening? (Part 1)

The good oldfashioned netstat.exe can tell you the ports that applications listen on. The result is plain-text, though. PowerShell can use regular...

Sending Objects to Notepad

In a previous tip we showed how you can send text to a fresh Notepad instance. Today, you get an enhanced version of Out-Notepad: you can pipe...

Send Text to Notepad

Notepad can be used to display text results. Typically, you would need to save text results to file, then have Notepad open that file. There is a...

Magic Underscore Variable

Here is a very special (and very underdocumented) way to use PowerShell parameters. Have a look at this function: #requires -Version 2 function...

Converting Currencies

PowerShell is an extremely powerful language and can access web services and web pages. If you combine that with dynamic parameters, you get a...

Counting Pages in a Word Document

Let's assume you have a bunch of Word files and would like to know how much pages they contain. Here is a function that takes the path to one...

Bringing Window in the Foreground

PowerShell can use Add-Type to access internal Windows API functions. This way, it is easy to bring any process window into the foreground. Here is...

Process Data (Part 3)

In parts 1 and 2, you learned how a PowerShell function can process information that was submitted to parameters or piped via the pipeline. In our...

Process Data (Part 2)

In part 1 we showed how a PowerShell function can receive input both from a parameter and via the pipeline, and process it in real-time. This is the...

Processing Data (Part 1)

This is the first of the three tips showing you how a PowerShell function can accept data via pipeline or parameter. In part 1, the function...

Get UI Information for Processes

PowerShell can use UIAutomation calls to find out useful UI information about any process. You can find out whether a process accepts keyboard...

Compressing to ZIP Files

In PowerShell 5.0, Compress-Archive can easily compress files and folders to a ZIP file: PS C:\> Compress-Archive -Path c:\sourcefolder...

1 93 94 95 96 97 237