All Versions There are free Active Directory cmdlets from Microsoft (part of the RSAT tools) and Dell (Quest). They take the complexity out of...
Powershell
Finding Read-Only and Constant Variables
All PowerShell versions Some variables are protected and cannot be changed. To identify these, take a look at this line: Get-Variable | Where-Object...
Read-Only and Strongly Typed Variables
All PowerShell versions To make PowerShell scripts more robust, you can code a lot of requirements right into your script variables. When you do...
Using Constants
All PowerShell versions Variables in PowerShell are volatile. You can overwrite and delete them – unless you create constants. Constants can...
Including Resources with Your Scripts
PowerShell 3.0 and later If your script needs additional resources, like text lists of server names, or picture files, or anything else, then make...
Using “more” in the PowerShell ISE
PowerShell ISE In the PowerShell console, you can pipe commands to the old-fashioned “more.com”, or better yet, to Out-Host...
Read User Profiles from Registry
All versions To find out which users have a (local) user profile on your machine, and where this profile is located, try this snippet: $path =...
Reading Associated File Extensions from Registry (Part 2)
All versions In a previous tip you learned how a one-liner can read multiple registry keys. In part 2, check out this one-liner: $lookup =...
Reading Associated File Extensions from Registry
All versions PowerShell code can be extremely dense. Here is a one-liner that reads all associated file extensions from the Windows Registry:...
Sort Things with Type
All Versions Sort-Object is your one-stop solution for sorting. If it’s primitive data, simply pipe it to Sort-Object. If it is object data,...
Opening Webpages from PowerShell
All versions Let’s assume you would like to open your favorite websites in a browser when you start your day. PowerShell can do this for you...
Measuring Website Response (and Execution Times)
PowerShell 3.0 and later Sometimes it is important to know just how long a command takes. For example, to monitor web site response times, you could...
Unfolding Object Data Structure
PowerShell 3.0 and later Objects can contain nested properties, and the data you are after may be “somewhere” inside an object. To...
Suppress Confirmation
All PowerShell Versions Some cmdlets (like Remove-ADGroupMember) automatically ask for confirmation. This can be a problem in scripts running...
Getting Cmdlet Help No Matter What
PowerShell 3.0 and later Beginning in PowerShell 3.0 PowerShell no longer ships its help files. Instead, you need to download them via Update-Help,...
Examining Wi-Fi Adapters and Power Management
Windows 8.1/Server 2012 R2 Windows 8.1 and Server 2012 R2 come with a bunch of highly useful cmdlets for network adapter management. When you want...
Using Finally for Crucial Cleanup Tasks
PowerShell 2.0 and later In a previous tip we introduced an “acoustic progress bar” that made PowerShell play a sound for as long as it...
Automating PowerShell ISE
PowerShell 3.0 and later PowerShell ISE is completely scriptable and is accessible through the $psISE variable. This variable is present only within...
Finding Process Owner
PowerShell Version 3 or better Get-Process gets you a list of all running processes, but it will not reveal the process owner. To find the process...
Using JSON-based Web Services
PowerShell 3 and better There are plenty of information web services out in the Internet, and many of them return results in JSON format. Here is an...
Using Arrays as Parameter Default Values
PowerShell 3.0 and later If you define a PowerShell function with some parameters, and you want a given parameter to have a default value that is an...
Shorten the Prompt
PowerShell 3.0 and later By default, PowerShell includes the current path into the prompt, and when you launch PowerShell as regular user, the...
Getting DELL Warranty Information (Part 2)
PowerShell Version 2.0 and later In a previous tip we illustrated how you can use a web service to retrieve warranty information for DELL computers....
Normalizing File Extensions
PowerShell 2.0 and later Let’s assume you want the user to submit a list of file extensions, or you are getting them from some other source....