posts-powershell

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:...

Auto-Documenting Script Variables

Ever wanted to get a sorted list of all variables used inside a script? Use this function: simply call Get-ScriptVariables and supply a path to your...

Encrypting Scripts With A Password

In a previous tip, you have learned how you can encrypt a PowerShell script using your identity as a secret key. You might prefer to use a...

Encrypting PowerShell Scripts

Sometimes, you may want to hide the code of your PowerShell script in order to protect passwords contained within the code. One way to safely...

Finding Out Whether A Web Page Is Open

The Shell.Application COM object returns a list of all open windows, including all opened IE browser windows. This way, you can find out whether a...

Accessing Internet Explorer

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

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...

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...

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...