Announcing the General Availability of IDERA SQL Safe Backup 9.3
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
Hiding Code from ISE Debugger
Typically, when you set breakpoints in your script and then step through your code using F11 or "Debug/Step Into", the debugger will visit all lines that are executed. Sometimes, however, you may not want to step through some functions, or you want to make...
Exploring PowerShell "Suggestions"
In the PowerShell console, you may have noticed "suggestions" that appear with common errors. Suggestions are designed to help you better understand the error. Suggestions are hard-coded into PowerShell and only appear in the console. They do not appear in...
Analyzing PowerShell Errors
PowerShell logs all errors in $error variable (unless the cmdlet uses -ErrorAction Ignore). $error contains the error records which in turn contain a property named HistoryID that links to the command that produced the error. By looking up the history list, you can...
Using Script Validators with Variables
As pointed out in a previous tip, PowerShell 3.0 now supports the use of validators for variable assignments. This is a great way of ensuring that a variable cannot contain illegal data. One of the most versatile validators is the ValidateScript attribute. This...
Waiting for Service State
Most high-level cmdlets dealing with services have built-in code to wait for state changes. So when you run Restart-Service to restart a service, the cmdlet will pause the script until the service indeed has restarted, and even display a warning message if this takes...
Controlling Numeric Range for Variables
In a previous tip we illustrated how in PowerShell 3.0, you can now use validators to restrict the data that can be assigned to a variable. Here is another example. It assigns the data type "Int32" to a variable, so it only accepts numeric values. In...
Mobile Dashboard Plugin Linux
Hi  I’ve recently tried to install the mobile dashboard plugin 1.2 on my rhel 6.3 monitor station running uptime 7.1, and noticed its only compatible with windows, I came across another thread on the forum dated Jan 2013 regarding the same issue, do you have...
Killing All Remote PowerShell Sessions
In a previous tip we explained how you can enumerate who is connected to your machine via PowerShell Remoting, and how you can terminate individual remote shells. If you want to simply kill all remote PowerShell sessions running on your machine, you can restart the...
Killing Remote PowerShell Sessions
To kill a remote PowerShell session that runs on your machine, you could kill the wsmprovhost.exe task associated with it, but identifying the correct process and killing it is not a robust and recommended way. A better way uses this approach: $URI =...
Finding Remote Sessions Connected to Your Machine
Ever wanted to find out who is running a (hidden) remote PowerShell on your machine? Here's a simple one-liner: Get-WSManInstance -ConnectionURI ('http://{0}:5985/wsman' -f $env:computername) `-ResourceURI shell -Enumerate It will return anyone connecting...
Define Variable Checkers
When you assign a mandatory data type to a variable, then this will improve script robustness: whenever a value is (accidentally) assigned to that variable that does not match the expected type, an error is raised. In PowerShell 3.0, this concept can be further...
Make Parameters Mandatory and Optional at the Same Time
An often overlooked feature in PowerShell is the ability to make a function parameter both optional and mandatory - at the same time. Let's for example assume you want a function that has two parameters: ComputerName and Credential. Both should be optional, but if the...
Enabling Visual Styles
When you use Windows Forms dialogs and windows, you may have noticed that they show differently, depending on whether you launched your script from within the ISE editor or from the powershell.exe console. This is because the ISE editor enables visual styles by...
Finding PowerShell Module Requirements
PowerShell modules extend functionality by adding more cmdlets and/or providers. Modules support copy-and-paste deployment ("XCopy-deployment", if you like), so theoretically, you can copy any module from one computer to another and use it there (use...
Using ValidatePattern attribute
PowerShell can validate parameters using regular expressions. This example accepts only computer names that start with "PC" followed by three digits: function Get-PCInfo { param ( [ValidatePattern( '^PC\d{3}$' )] [String] $ComputerName )...
Creating Script Blocks from Strings
Sometimes you may want to create a script block dynamically from a string. This could be necessary to include local variable content, for example. To turn a string into a script block, you cannot cast the string. Instead, use this approach: $folder =...
Analyzing Script Blocks
Script blocks are simply pieces of PowerShell code. You probably use them all the time in scripts and functions. A script block is defined by braces and could be as simple as this: $a = { Get-ChildItem C:\ } Now, the variable $a holds code that can be handed over to...
Creating Simple Custom Dialog
PowerShell can display custom dialogs easily. So if you're not satisfied with the dialog buttons available in a standard MsgBox dialog, simply create your own. Here's the raw code for a very simplistic two-button dialog that appears centered on screen above...
Getting Screen Information
Ever needed to know the current screen resolution or related screen information? Here's an easy way of getting that information: Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Screen]::AllScreens [System.Windows.Forms.Screen]::PrimaryScreen Note...
Disassembling C# Code
Adam Driscoll, another PowerShell MVP, has published a function called Get-MemberBody to PoshCode: http://poshcode.org/4127. In conjunction with the free tool "ILSpy", you now can easily disassemble and look at source codes for .NET functions. After you...