In the previous tip we looked at how to efficiently count items like files in a folder. Here are some more examples. Counting the number of files in...
database-tools
Counting Files Efficiently (Part 1)
A quick and dirty approach for counting files could be this: (Get-ChildItem -Path c:\windows).Count However, it would produce some memory load...
Uncovering TinyUrls’ True Origin
URL shortening is great for Twitter messages but hides the origin. Would you really trust http://bit.ly/e0Mw9w? Here is a simple approach that lets...
Creating Colorful Weather Report
In the previous tip we explained how you can retrieve weather forecast data using Invoke-WebRequest. This was pure black-and-white text. To get a...
Get Weather Forecast
Invoke-WebRequest can easily retrieve web page content for you. If you run it without the –UseBasicParsing parameter, the HTML is even parsed...
Avoid Read-Host
Do you use Read-Host to receive user input? If you do, rethink. Read-Host always prompts a user, and there is no way to automate scripts that use...
Using Online Help
PowerShell does not ship with help files, and installing help files locally requires Administrator privileges. A much easier approach can often be...
Outputting and Assigning at the same time
In the previous tip we talked about logging script results, and how you can assign values and at the same time output the assigned values by using...
product-oriented educational blog posts for SQL Admin Toolset
Here is a list of product-oriented educational blog posts for SQL Admin Toolset: How to Ensure That Databases Are Backed Up On a Regular Basis How...
Logging Script Output
There are numerous ways to log script output but one especially lazy technique is to run Start-Transcript. In PowerShell 5, this cmdlet is supported...
Installing Modules in PowerShell Core on Linux
When you’d like to install modules for all users from the PowerShellGet repository, you need Administrator privileges. On PowerShell Core on...
“Braces Secret” with PowerShell.exe
Here is a little secret that applies to powershell.exe when it is called from within PowerShell or PowerShell Core: when you run powershell.exe and...
Monitoring MySQL Problematic Queries
This blog describes how to identify queries that cause a sudden spike in system resources as well as the user and host who executed the culprit...
Parsing Distinguished Names
Distinguished names are strings, and strings contain powerful ways of parsing data. The most powerful yet simple approach is the Split() method....
Auditing Logons
Have you ever wondered whether someone has logged into your PC while you were away? In a previous tip we explained how you can examine the rich...
product-oriented educational blog posts for SQL Diagnostic Manager
Here is a list of product-oriented educational blog posts for SQL Diagnostic Manager: Five Important Features of SQL Diagnostic Manager How to...
Finding UAC Elevations
The Windows “Security” log contains rich audit information. By default, it logs all requests for privilege elevation which occurs when...
Instantly Access Data in Backup Files to Improve Database Continuity
SQL Server databases are often repositories for large volumes of business-critical data. As the sizes of databases grow, restore operations become...
How to Correctly Wrap Multiple Results
Whenever a PowerShell function needs to return more than one kind of information, it is important to wrap them as objects. Only then will the caller...
IDERA ER/Studio Repository Database Setup and Ports – Part 1 – SQL Server
Howdy! In this latest blog post, I will be covering the Database setup one would need for our IDERA ER/Studio Repository. ...
Explore WMI
Get-WmiObject and Get-CimInstance both can provide you with a lot of valuable information, provided you know the name of WMI classes to query. Here...
Registering Default PowerShell Repository
If you use the PowerShellGet module (which ships by default on Windows 10 and Server 2016), you can easily download and install shared PowerShell...
How to Tune the Performance of SQL Server, Azure SQL Database and Amazon RDS
SQL Doctor diagnoses and provides the cure for what ails SQL Server on premise, in the cloud, and as a managed cloud database. Collect...
Find Installed Software
Most installed software registers itself in one of four places inside the Windows Registry. Here is a quick PowerShell function called...