database-tools

Use the CTRL+Arrow

Inside the PowerShell console, you can hold CTRL while pressing the arrow key to move the cursor word-by-word. This way, you can move the cursor...

read more

Change Service Startmode

You can use WMI like this if you want to change a service start mode: ([wmi]'Win32_Service.Name="Spooler"').ChangeStartMode('Automatic').ReturnValue...

read more

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