Powershell

Finding IP and MAC address

When you query network adapters with WMI, it is not easy to find the active network card. To find the network card(s) that are currently connected...

read more

Changing Units

When you list folder contents, file sizes are in bytes. If you'd rather like to view them in MB or GB, you can use calculated properties, but by...

read more

Closing Excel Gracefully

When you access Microsoft Excel from script, you may have noticed that it never gets removed from memory again, even if you call its Quit() method:...

read more

Formatting Currencies

Formatting numbers as currencies is straight-forward - as long as it is your own currency format: '{0:C}' -f 12.22 If you want to output...

read more

Creating PowerShell Menus

PowerShell is console based, so its default menus are console based as well. To offer choices to your users, here is some sample code to create a...

read more

Bypassing Execution Policy

When execution policy prevents execution of PowerShell scripts, you can still execute them. There is a secret parameter called "-" . When you use...

read more