database-tools

Accessing All Users Desktop

Resolve-Path is an excellent cmdlet to find paths that have the same nesting level. For example, here's a really short script that creates a text...

Quickly Selecting Results in ISE

If you'd like to quickly select and copy results from the Console Pane of the PowerShell 3.0 ISE editor into your blog or favorite word...

Speeding Up Multiple WMI Queries

Whenever you run Get-WmiObject against a remote system, it will create a new connection. So if you query different WMI classes, each query will use...

Getting WMI IntelliSense

Get-WmiObject provides no IntelliSense for WMI classes, so you either need to know the WMI class name off hand, or use the parameter -List to search...

Listing "Real" Hard Drives

WMI can provide lots of information about a system, but sometimes it is just a bit too much. So when you query for logical disks, you often get back...

Improving Module Auto-loading

PowerShell 3.0 will auto-load modules as you have seen in a previous tip. However, with some modules, this technique may fail. Their cmdlets will...

Loading Modules Automatically

Beginning with PowerShell 3.0, PowerShell is smart enough to know which cmdlets are exported by which extension module. So you no longer have to...

Getting MAC Address Remotely

Here is an easy way to get the MAC address, even from a remote machine: Simply replace the IP address with the one you are interested in. You may...

Launching PowerShell as Different User

Once you pin PowerShell to your taskbar, you can always right-click the pinned PowerShell icon to open a jump list and launch PowerShell or the ISE...

Monitoring Log Files

Beginning in PowerShell 3.0, it is easy to monitor text-based log files in real-time. Try this: $Path = "$home\Desktop\testfile.txt"...

Keyboard Trick

In the PowerShell ISE 4.0 command pane, when you hold CTRL, you can then use ArrowUp to move out of the command line into the results area. ReTweet...

Getting Excuses Automatically

Tired of inventing lame excuses yourself? Then here's a script that gets you a new excuse any time you call Get-Excuse! All you need is Internet...

Capitalizing Words

To correctly capitalize words (making sure the first character is capitalized), you can either use regular expressions or a little system function....

Finding Default Outlook Profile

PowerShell can access COM objects like Outlook Application. These two simple lines return the current Outlook profile: $outlookApplication =...

Dynamic Methods in PowerShell 4

Beginning with PowerShell 4.0, method names may come from variables. Here's a simple example: $method = 'ToUpper'...

Dynamic Parameters in PowerShell 4.0

In PowerShell, you can use variables in place of properties. This sample script defines the four property names that return profile paths, then...

Finding Services in PowerShell

Get-Service lists all services on a computer, but the information returned is very sparse. You cannot easily see what a service does, whether it is...

Hiding Parameters from IntelliSense

Beginning with PowerShell 4.0, a script author can decide to hide function parameters from IntelliSense. This way, less frequently used parameters...