Featured Blog
Empowering Law Firms: How SQL Server and Idera Tools Safeguard Legal Data
Working With TimeSpan Objects
TimeSpan objects represent a given amount of time. They are incredibly useful when you calculate with dates or times because they can represent the...
Converting Low-Level Error Numbers into Help Messages
Sometimes, native commands such as net.exe return cryptic error numbers instead of full error messages. Traditionally, you could use the following...
Identifying 32-bit Executables
Thanks to Shay Levy from http://powershellmagazine.com for showing how to do this: here's a small function that returns the architecture an...
Creating String Arrays without Quotes
Often, you may need a list of strings and want to store it in a variable. The common coding practice is like this: $MachineType =...
Discover New "Internet"-Cmdlets in PowerShell 3.0
With Invoke-WebRequest and Invoke-RestMethod, PowerShell 3.0 now has powerful support for downloading information from the Internet as well as...
Using Help Window as Text Dialog
Did you know that you can use the Help Window that comes with PowerShell 3.0 and display your own text information inside of it? What's even...
Using Default Parameter Values
If you find yourself submitting the same value for a cmdlet parameter over and over again, then PowerShell 3.0 lets you set a default value. Once...
Find Matching Brace (or Parenthesis)
One common headache are non-matching braces or parentheses in PowerShell scripts. So when you write a script, it is recommended to align matching...
Using Central ISE Snippet Repository
In a previous tip we illustrated that ISE code snippets (press CTRL+J to view them) are plain ps1xml-files that you can manage in File Explorer. By...
Sharing and Exchanging ISE Code Snippets
By default, the PowerShell 3.0 ISE editor loads code snippets automatically, and you can then select and insert any of these by pressing CTRL+J....
Hiding Default ISE Snippets
The PowerShell 3.0 ISE editor ships with a number of default code snippets that you can see (and insert) by pressing CTRL+J. Once you start to...
Removing ISE Snippets
In a previous tip, we showed how you can use New-IseSnippet to add new code snippets to the ISE editor in PowerShell 3.0. These custom snippets stay...
Adding Custom Snippets to ISE editor
The new PowerShell 3.0 ISE editor features a snippet menu that lets you easily insert predefined code snippets. Simply press CTRL+J to open the...
Using Here-String Correctly
Whenever you need to assign multi-line text to a variable, you can use so-called here-string. This is a sample: $myCodeSnippet=@' function...
Using Regions in ISE Editor
PowerShell 3.0 ISE editor creates collapsible regions automatically, so you can collapse a function body or an IF statement. In addition, you can...
Accessing Latest Log File Entries
Sometimes you may just be interested in the last couple of entries in a log file. Here’s a simple yet fast way of outputting only the last x...
Finding IP GeoLocation Data
In a previous tip we illustrated how you can use web services to retrieve information such as public holidays or the location of an IP address....
Finding Public IP Address
Whenever a machine is connected to the Internet, it gets a public IP address (typically assigned by the ISP), and this public IP address is not...
Creating a Drawing Panel
In PowerShell 3.0, WPF is a great (and easy) way of creating GUIs. If you have a touch-enabled machine, check out how easily you can open a drawing...
Changing Files without Changing Modification Date
Whenever you change a file, the file system automatically updates the LastWriteTime property. If you'd like to change a file without leaving...
Getting Holiday Dates
Ed Wilson from the Scripting Guys demonstrated how PowerShell can use free web services to find out holidays. You do need direct (non-proxy)...
Replacing Aliases with Command Names
Aliases are shortcuts for commands and useful in interactive PowerShell. Once you write scripts, however, you should no longer use aliases and...
Identifying Origin of IP Address
Ever wondered how a website knew which country you are from? That's because there are IP address segments assigned to certain regions. And...
Documenting CPU Load for Running Processes
Get-Process can easily return the CPU load for each running process, but this information by itself is not very useful: Get-Process | Select-Object...
Temporarily Locking the Screen
PowerShell 3.0 uses .NET Framework 4.x so it has WPF (Windows Presentation Foundation) capabilities built-in. This way, it only takes a few lines of...
Renaming Script Variables
Often, when you start writing a PowerShell script, you use temporary (dirty) variable names that later you'd like to polish. Renaming script...
Using Outlining to Make Scripts Easier to Read
ISE 3.0 features automatic outlining, so structures like braces can be collapsed or expanded by clicking the small "+" or "-"...
SQLite, good enough for guided missle destroyers
SQLite is an Open Source embedded database that has become very popular over the years. Our support for SQLite has been limited because of the lack...
Auto-Documenting Script Variables
PowerShell can automatically find and list all variables that you use in a script. This way, you can easily create variable documentation for your...
Turning ISE into a Custom PowerShell Console
A lot of products come with their own PowerShell consoles. There are special PowerShell consoles for Exchange, for SQL Server, for Active Directory,...