PowerShell 3.0 and later Sometimes, it is hard to find out why a PowerShell script is not doing what it should do. To get a better understanding of...
Powershell
Using Code Regions in ISE
PowerShell 3.0 and later PowerShell ISE already supports collapsible code regions. When you write functions, loops, or conditions, you will notice a...
Process Killer (and some gotchas)
PowerShell 3.0 and later In a previous tip we explained how you can turn Out-GridView into a selection dialog, and suggested a couple of ideas. One...
Out-GridView: Universal Dialog
PowerShell 3.0 and later By default, Out-GridView is a one-way road: you can pipe data into it and display it in a grid view window, but you cannot...
Finding All Stoppable Services
PowerShell 3.0 and later Get-Service lists all services installed on your computer. It has no parameter to select only running or stopped services,...
Exporting Out-GridView Content
PowerShell 3.0 and later Out-GridView is a very useful cmdlet to output results to an extra window. Unlike outputting to the console, Out-GridView...
Getting a Clean PowerShell Environment
PowerShell 3.0 and later When you develop PowerShell scripts in the PowerShell ISE, you will probably make a lot of changes and revisions, and...
Adding PowerShell Tools to Windows 8 Start Screen
Windows 8/Windows 8.1 You may have noticed that the Windows 8 start screen by default is missing PowerShell tools like the PowerShell ISE. When you...
Find AD Replication Failures
Windows 8.1, Server 2012 R2 Investigating Active Directory replication failures becomes easy with Windows 8.1 and Server 2012 R2. A new cmdlet...
Useful Static .NET Methods
All Versions PowerShell can access static methods of .NET types. Here are some real world one-liners that can do a lot for you: [Math]::Round(7.9)...
Mandatory Parameters with a Dialog
All Versions Typically, when you declare a parameter as mandatory, and the user does not submit it, PowerShell takes care and prompts the user for...
Use Open File Dialog
All PowerShell versions To add some sophistication to your script, here is a simple function that opens the OpenFile dialog and lets the user pick a...
Logging Folders with Access Denied Errors
All Versions When you browse the file system with Get-ChildItem, you may stumble across folders that you have no access to view. If you’d like...
Managing Terminal Service Settings
ActiveDirectory Module Sometimes you may want to directly access properties related to the terminal service in an Active Directory account. Here is...
Credential Obfuscator
PowerShell ISE 3.0 and later While it is generally not recommended to hard code passwords in scripts, there are sometimes scenarios where this is...
Automatic Unrolling and Memory Consumption
PowerShell 3.0 and later In PowerShell 3.0, a new feature called “Automatic Unrolling” was introduced. With it, you can write code like this:...
Copying Command Line History
All PowerShell versions To preserve all the PowerShell commands that you entered in a PowerShell session, check out this one liner:...
Getting Computer Serial Number
All PowerShell versions In a previous tip we illustrated how you can take a DELL serial number and check online the warranty status. Other vendors...
Checking DELL Warranty Online
PowerShell Version 2.0 and later If you own a DELL computer, you can take advantage of a web service that takes your computer serial number and...
Cmdlets to Manage MSI Packages
PowerShell 2.0 and later Anyone who needs to manage MSI installer packages may benefit from an open source project found here:...
Reading Multiline Text
PowerShell 3.0 and later Sometimes you will stumble across tips like the following one: $FilePath = "$env:SystemRoot\WindowsUpdate.log"...
Requiring Administrator Privileges
PowerShell 4.0 and later If you know that a given script needs Administrator privileges, then a simple #requires statement is enough to make sure...
Analyzing and Removing Print Jobs
Windows 8.1 or Server 2012 R2 Both Windows 8.1 and Server 2012 R2 come with a module called “PrintManagement”. It includes all cmdlets...
Listing All Print Jobs
Windows 8.1 or Server 2012 R2 Both Windows 8.1 and Server 2012 R2 come with a module called “PrintManagement”. It includes all cmdlets...