All PowerShell Versions When you get back results from PowerShell cmdlets, the results are objects and have properties. Some properties can be...
Powershell
Categories
- Free tools
- SQL Admin Toolset
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Doctor
- SQL Enterprise Job Manager
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Getting a Variable Inventory
PowerShell ISE 3 and later For documentation purposes, you may want to get a list of all variables that a PowerShell script uses. Here is a function...
Renaming Variables
PowerShell ISE 3 and later Here is a simple variable renaming function that you can use in the built-in ISE editor that ships with PowerShell 3 and...
Normalizing Line Endings
All PowerShell Versions When you download files from the Internet, you may run into situations where the file won’t open correctly in editors....
Identifying Network Vendors by MAC Address
All PowerShell Versions Each MAC address uniquely identifies a network device. The MAC address is assigned by a network equipment vendor. So you can...
Getting MAC Addresses
All PowerShell Versions Getting the MAC of a network adapter is rather simple in PowerShell. Here is one of many ways: PS> getmac /FO CSV |...
Advanced Text Splitting
All PowerShell Versions When you use the –split operator to split text, then the split text is consumed: PS> 'Hello, this is a text,...
Text Splitting
All PowerShell Versions With the –split operator, you can split text at given locations. The operator expects a regular expression, so if you...
Replacing Duplicate Spaces
All PowerShell Versions To eliminate any duplicate space, try this regular expression: PS> '[ Man, it works! ]' -replace...
Creating TinyURLs
All PowerShell Versions You probably have heard about shortening long URLs. There are plenty of free services available. Here is a script that turns...
Finding PowerShell Functions
PowerShell 3.0 and later To quickly scan your PowerShell script repository and find all files that have a given function in them, try this filter:...
Dumping Service State Information
All PowerShell Versions If you would like to save the results of a PowerShell command to disk so that you can take it with you to another machine,...
Comparing Service Configuration
PowerShell 3 and later Provided you have PowerShell remoting up and running on two servers, here is a simple script that illustrates how you can get...
Download PowerShell Language Specification
All PowerShell Versions With PowerShell, it is really easy to download files from the Internet. Here is the code that downloads the PowerShell...
Waiting for a Keystroke
All PowerShell versions, PowerShell Console only To keep the PowerShell console open when a script is done, you may want to add a “Press Any...
Finding Errors in Scripts
All PowerShell Versions It’s never been easier to find scripts with syntax errors in them. Just use this filter: filter Test-SyntaxError {...
Testing Whether Text Contains Upper Case
All PowerShell Versions Use regular expressions to check whether a string contains at least one upper case letter: $text1 = 'this is all...
Getting the Number of Lines in a String
All PowerShell Versions Here is a clever trick how to find out how many lines a string (not a string array!) contains: $text = @' This is some...
Discarding Results
All PowerShell Versions Since PowerShell returns anything that commands leave behind, it is particularly important in PowerShell scripts to discard...
Optional and Mandatory at the Same Time
All PowerShell Versions Can parameters be optional and mandatory at the same time? They can, based on context. A parameter can be mandatory when...
Important Math Functions
All PowerShell Versions Here are the four most important Math functions needed by administration scripts: [Math]::Floor(4.9) [Math]::Ceiling(3.2)...
Useful Path Manipulation Shortcuts
All PowerShell Versions Here are a bunch of useful (and simple to use) system functions for dealing with file paths:...
Finding Minimum and Maximum Values
All PowerShell Versions To find the smallest and largest item in a range of numbers, use Measure-Object: $list = 1,4,3,1,3,12,990 $result = $list |...
Combining Results
All PowerShell Versions Let's assume you want to identify suspicious service states like services that are stopped although their start mode is...
Countdown Hours
All PowerShell Versions Whether it is a birthday or an important game, you may want PowerShell to tell you just how many hours it is till the event...
Using -f Operator to Combine String and Data
All PowerShell Versions Strings enclosed by double-quotes will resolve variables so it is common practice to use code like this: $name = $host.Name...
Playing WAV Sounds
PowerShell 3.0 or later To play a WAV sound file in a background process, PowerShell can use the built-in SoundPlayer class. It accepts a path to a...
System Uptime
All PowerShell Versions Windows starts a high definition counter each time it boots, and this counter will return the milliseconds the system runs:...
Finding Attached USB Sticks
All PowerShell Versions If you'd like to know whether there are currently USB storage devices attached to your computer, WMI can help:...
Test Service Responsiveness
All PowerShell Versions To test whether a particular service is still responding, use a clever trick. First, ask WMI for the service you want to...