Often, when you start writing a PowerShell script, you use temporary (dirty) variable names that later you'd like to polish. Renaming script...
blog
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 "-"...
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,...
Using the ISE Debugger
ISE has a simple yet effective debugger built-in that you can use to step through your code. The debugger does require that you save your script...
Switching Between Console and Editor
In ISE 3.0, you can easily switch focus between the interactive console pane and the editor script pane by pressing CTRL+D (to go to the console)...
Finding Matching Brackets
Sometimes, in larger PowerShell scripts it is hard to find the corresponding opening or closing bracket or brace. One thing you can do, of course,...
Finding Built-In ISE Keyboard Shortcuts
Thanks to MVP Shay Levy from http://powershellmagazine.com fame, here's a quick way of dumping all ISE 3.0 keyboard shortcuts; a lot of them are...
Secret Script Block Parameters
If you think you understand PowerShell parameter binding, then have a look at this simple function which exposes a little-known PowerShell behavior:...
Get-Member Receives Array Contents
If you need to know the object nature of command results, you probably know that you can pipe them to Get-Member like this: Get-Process |...
Removing Leading Zero from IP Addresses
Here is another (and very solid) approach to remove leading zeroes from an IP address using a regular expression: '010.012.000.101' -replace...
Get Fully Qualified Domain Name
There are two simple tricks to find out your current fully qualified domain name (FQDN). You can either resort to ping.exe: PS> ping -a localhost...
Finding Next Sunday
If you'd like to find out how long it is until next Sunday (or how many days have passed since last Sunday), simply use the property DayOfWeek. It...
Launching Applications with Alternate Credentials
If you must run an application with a different identity, Start-Process offers the parameter -Credential. This would launch the Notepad editor using...
Configure SQL diagnostic manager for non-standard ports
SQL Server uses the port 1433 as its standard listening port. Hackers know this and will use it to more easily hack into your SQL...
Manipulating Scheduled Tasks
If you need to change and adjust settings in a registered scheduled task, there is a COM interface called 'Schedule.Service' that you can...
Dumping Scheduled Tasks
There is an underestimated option to make schtasks.exe dump scheduled tasks as CSV data. PowerShell can grab the CSV data and turn it into objects,...
Create Strongly Typed Hash Table
A hash table can store any data type. If you want more control, you can create a typed dictionary (which behaves pretty much like a hash table): $ht...
Why Back Up the Transaction Log if not Interested in Point-in-time Restore?
I’ve heard people say many times that they don’t use full or bulk-logged recovery model or backup the transaction log of their database...
Make Your PowerShell Scripts Click-runnable
If you are like me, you hate having to type in the full path to a PowerShell script to run it.Wouldn’t it be nice if you could just execute...
Is Using RECONFIGURE WITH OVERRIDE dangerous?
One of my pet peeves is the use of RECONFIGURE WITH OVERRIDE in scripts to change server options. Am I being unreasonable or is this justified? All...
Increase SQL Server Performance Using Multiple Files
By default, SQL Server databases are comprised of two files: the primary data file (or .mdf) and the log file (or .ldf). It is, however, possible to...
Getting the Permissions Wired-Up Properly When Attaching a Content Database to a SharePoint Farm
You’ve probably heard the latest news in the SharePoint world: SharePoint 2013 has been released to manufacturing (RTM)! We’ve been told...
BUMMER
USE mysql; SHOW FULL TABLES WHERE table_type = 'base table'; /* returns ... innodb_index_stats BASE TABLE innodb_table_stats BASE TABLE ......