database-tools

Looking Up Cryptic Error Codes

All PowerShell versions Often, WMI and API calls return cryptic numeric error codes. To find out what went wrong, try this little helper function:...

Converting Error Numbers

All PowerShell Versions Error numbers that are returned by Windows API calls often appear as very large negative numbers. To give meaning to these...

Creating HTML Colors

All Versions To convert decimal color values to a hexadecimal representation, like the one used in HTML, try this line: PS>...

Getting Help

PowerShell 3.0 and later Provided you have downloaded PowerShell help via Update-Help, you can create yourself an excellent help topic viewer with...

SMO – SQL Server Management Objects

SMO stands for Shared Management Objects. It is a SQL administration API used to get meta data information from SQL Server. You may ask “Why? I can...

MongoDB – Data Modeling Primer

We all know and have been hearing about NoSQL systems since the last year or so! 2014 is slated to be the year of NoSQL DB Platforms and Big Data...

Break Into Script with PowerShell 5.0

PowerShell 5.0 Preview As you might know, PowerShell 5.0 Preview is available and comes with vast debugging improvements. One is to be able to debug...

Watch Rick Astley Dance and Sing!

All PowerShell Consoles (not PowerShell ISE) Before you try this, you may want to click the icon in the upper left corner of the PowerShell title...

Pinging via IPv4

All PowerShell versions You can use ping.exe just like any other command inside PowerShell scripts. By adding “-4” to the command line,...

IF_THEN_ELSE_RapidSQL

This week I’ll take a look at IF-THEN-ELSE-ELSEIF syntax.  Next blog I’ll take a look at the similar CASE syntax and compare/contrast the...

Use F1 in PowerShell ISE

PowerShell ISE 3 and later When you have downloaded the PowerShell help files (using Update-Help from an elevated shell), you can use the Get-Help...

Functions Always Beat Cmdlets

All PowerShell versions Functions always have higher rank than cmdlets, so if both are named alike, the function wins. This function would...

Use Out-Host instead of More

PowerShell Console Note that any of this will only work in a “real” console. It will not work in the PowerShell ISE. To output data page...

Invoke-Expression is Evil

All PowerShell versions Try and avoid Invoke-Expression in your scripts. This cmdlet takes a string and executes it as if it was a command. In most...

Importing and Installing Certificate

All PowerShell versions To programmatically load a certificate from a file and install it in a specific location inside the certificate store, have...

Using Notepad to Print Things

All PowerShell versions To print a text-based file with the Notepad, try using this line (replace the path to the text file with some path that is...