Powershell

Alternate Get-Service

The cmdlet Get-Service has a number of drawbacks. For example, there is no parameter to filter running or stopped services, and the results do not...

Robocopy Light

Robocopy.exe is an extremely powerful and versatile built-in command to copy files efficiently from one location to another. Unfortunately, this...

Create Summary Objects for Inventory

Beginning in PowerShell 3, a PSCustomObject can easily combine valuable information that you gathered from different sources. Here is an example...

Scraping Quotes from WikiQuote

Here is a fun script that may not work forever. It takes one or more topics you choose, then returns one or more random quotes taken from the...

Controlling Audio (Mute and Volume)

Ole Morten Didriksen has dug out some API calls that enable audio volume control (https://gist.github.com/oledid). With this, it is trivial from...

A better Get-History

When you type “h” in PowerShell, you see the history of commands you entered during your session. Inspired by Pratek Singh...

Getting MAC Vendor List

Prateek Singh has invested some effort in creating a sanitized MAC vendor address list in CSV format which can be found in his blog...

Auto-Logging Command Output

In the previous tip we introduced the PreCommandLookupAction supported by PowerShell 3 and better. Today we have a special implementation for you....

Replacing Commands

PowerShell comes with a couple of “secret” (better: under-documented) settings. One is PreCommandLookupAction, and it gives you great...

Easy Parsing of Setting Files (Part 3)

In the previous tip you have discovered how ConvertFrom-StringData can turn plain text key-value pairs into a hash table. What’s missing is...

Easy Parsing of Setting Files (Part 2)

In the previous tip we used ConvertFrom-StringData to parse plain text key-value pairs into hash tables. Here is an example where such conversion...

When Add-Type Fails…

Add-Type can be used to load additional .NET assemblies from DLL files into PowerShell. This works well most of the time, and here is a sample call...

1 32 33 34 35 36 104