database-tools

Using Robocopy to Copy Stuff

You should avoid cmdlets if you need to copy large files or a large number of files. Instead, you should use native commands like robocopy. This...

Hiding NetworkAdapter

When you use VMware, or if you have installed a Microsoft Loopback adapter, these adapters will show up in your network panel as "Unidentified...

Resetting Network Adapters

Sometimes, it is necessary to reset network adapters, such as after you changed settings for that adapter in your registry. Resetting a network...

Disabling Network Adapters

If you need to systematically disable network adapters, all you need is the name of the adapter (as stated in your control panel or returned by...

Enumerating Network Adapters

Finding your network adapters with WMI isn't always easy because WMI treats a lot of "network-like" adapters like network adapters. To...

Test Admin Privileges

If you want to systematically test whether you currently have Administrator privileges, you can use this function: function Test-Admin { $identity =...

Re-Running Your Profile

If you made changes to your profile script and want to see the changes that are in effect without having to close and restart PowerShell, you can...

Create (and Edit) your Profile Script

Profile scripts are automatically executed whenever PowerShell launches. Your profile script is the perfect place to customize your PowerShell...

Strongly Typed Arrays

When you assign strongly typed values to an array, the type declaration will remain intact only as long as you do not add new array content: $array...

Running 32-Bit-Code on 64-Bit Machines

Some code may not work right on 64-Bit machines. Use this approach to make PowerShell execute code in an isolated 32-Bit PowerShell session and hand...

Running Commands in the Background

You can also transfer commands into another PowerShell session and run it in the background. This will find all log files recursively in your...

Escaping Spaces

You should remember that spaces are special characters in PowerShell, too. They are token delimiters, and once you feed arguments to a native...

Downloading Internet Files with Dialog

There is a great way to download large files from the Internet. This example downloads a tutorial video from Idera that, once downloaded will run in...

Using OpenFile Dialog

You can use this code to open a standard OpenFile dialog in your PowerShell scripts:...

Finding Methods with Specific Keywords

As such, .NET Framework is huge and full of stars, and it is not easy to discover interesting methods buried inside of it. You can use the next...

Running Programs as Different User

If you ever needed to run a program as someone else, you can use Start-Process and supply alternate credentials. When you do that, you should also...

Run Programs Elevated

If you have User Account Control (UAC) enabled, you may want to run a program elevated. That's easy using Start-Process and the -verb parameter....

Clearing Console Content

When you want to clear the console content, you probably use "cls" or Clear-Host. For some strange reason, the Clear-Host cmdlet really is...