database-tools

Load Cmdlets from PSSnapins

Most cmdlets these days are organized in modules. Modules were introduced in PowerShell 2.0. Their main advantage is copy&paste deployment (no...

DBA Triage Using Heatmaps

The word “triage” for me brings up images from MASH re-runs; or memories of emergency room visits with nurses quickly deciding whether you are...

Loading PowerShell Modules

All cmdlets live in modules or snap-ins. To see which modules are currently loaded, use Get-Module. In PowerShell 3.0 or better, most modules are...

Get CPU Cores and Processor Information

WMI can find out details about your CPUs in just one line: PS> Get-WmiObject -Class Win32_Processor | Select-Object -Property Name, Number* Name...

Installing Windows Features

On servers, PowerShell can install Windows features with the cmdlet Install-WindowsFeature. When you save the result emitted by...

Create Dynamic Script Blocks

Script blocks are pieces of executable PowerShell code. You typically create them by enclosing code in braces. To dynamically create script blocks...

Manage NTFS Permission Inheritance

By default, folders and files inherit permissions from their parents. To stop inheritance and make sure only the explicitly assigned permissions are...

Removing Explicit NTFS Permissions

In previous examples, we showed you how you can add new NTFS permissions to an existing folder. If you want to reset permissions and make sure all...

Getting Explicit NTFS Permissions

To find out which NTFS access permissions have been assigned directly to a file or folder, check for the property "isInherited". This will...

Managing NTFS Permissions

In a previous tip we showed how you can add NTFS permission rules to a folder. To find out what kind of permissions are assignable, take a look at...

Create Folder with NTFS Permissions

Often, you may need to create a new folder and also set NTFS permissions for the folder. Here is a simple example that creates a new folder and...

Splitting Long Lines

To improve readability, you can break PowerShell lines into separate lines. Get-Service | Where-Object { $_.Status -eq 'Running' }...

Prompting for Function Parameters

With a simple trick, you can add a dialog window that helps users to provide the function parameters for your function. Simply use...

Playing Sound in the Background

If your script takes some time to complete, you may want to play a system sound file. Here is a sample illustrating how this can be done: # find...

Finding Executable

Many file extensions are associated with executables. You can then use Invoke-Item to open a document with this executable. Finding out just which...

Finding Uppercase Characters

If you'd like to find uppercase characters, you could use regular expressions. However, you would then provide a list of uppercase characters to...

Using Symbols in Console Output

Did you know that console output can contain special icons like checkmarks? All you need to do is set the console to a TrueType font like...

1 92 93 94 95 96 159