database-tools

Passing ByRef vs. ByVal

Usually, when you assign a variable to another variable, its content is copied. Here is an example: $a = "Hello"$b = $a$a = "Hello...

read more

Ejecting CDs

PowerShell can still use COM libraries. Simply use New-Object -comObject and provide the COM library name to load it. With this approach, you can do...

read more

Deleting Aliases

As you may know aliases are shortcuts to other commands. So, you can easily add new aliases like this: Set-Alias edit notepad.exe The next time you...

read more

Creating Text Files

PowerShell offers you a multitude of ways to write information to disk. Here's a quick overview. 1. You can use classic redirection:...

read more

Accessing Internet Explorer

Accessing Internet Explorer can be useful for obtaining Web content. The usual approach uses a COM object called InternetExplorer.Application like...

read more

Detect DHCP State

You can use WMI and Win32_NetworkAdapterConfiguration to determine whether a computer uses DHCP to acquire an IP address. Simply look for all...

read more

Select Folder-Dialog

Want to provide your users with a neat dialog to select folders? Simply use a COM object called Shell.Application, which provides the...

read more

Sending Simple SMTP Mail

You need to notify an admin that something happened or something is finished and would like to send a quick e-mail from inside your PowerShell...

read more

Check Online Status

When managing more than just one system, you may want to remotely access those systems. Maybe you use WMI to do that. However, when you try and...

read more

An Easy InputBox

All user input and output normally occurs inside the PowerShell console. Simply access the .NET framework directly if you'd like to get back the...

read more