How to Call Functions in Powershell (Windows)

Functions in Powershell are called without any comma or parenthesis, although they are defined using them. The correct way to call a function with two variable parameters would be: test $local1 $local2 The wrong way is: test($local1, $local2) If you put parentheses around your parameters, your input is treated as an array and thus the ... Read more

Create a Self-signed SSL Certificate on Windows

SSL (Secure Socket Layer) is used for encryption and decryption, processing of S/MIME signed or encrypted mails, generation of certificates, and more. To use it on Windows (32 and 64 bit versions), download the OpenSSL tools from code.google.com/p/openssl-for-windows/downloads/list. Uncompress it anywhere you like and start it by double-clicking the openssl.exe executable in the \bin folder. ... Read more

How to Get all Active Directory Users Created in the Last 24 Hours using PowerShell

You may require in some cases to check an active directory for newly created users so you can send them an email. You may also require to get newly added users for auditing or security purposes. You can get the active directory users created in last 24 hours by using this script. Feel free to change it for ... Read more

How to Execute PowerShell Scripts Without Pop-Up Window

PowerShell scripts are hard to run without any kind of popup. Without using the small workaround that I will show you here, it may even be impossible. Even if you specify the -WindowStyle Hidden switch - this will only result in the PowerShell window blinking up for a split second and disappearing afterward. You can ... Read more

How to Comment Out Code in PowerShell Script

PowerShell Code Commenting

This guide gives you an overview of code commenting options in PowerShell. Just like any other programming language, you can comment out code in a PowerShell script for documentation purposes. Single-line comments in PowerShell To comment out a single line, put '#' in the beginning: Multiline Comments in PowerShell To comment out multiple lines, put ... Read more

How to Get a List of Windows PowerShell Modules that can be Imported

Modules are collections of cmdlets that are stored in the path %WINDIR%\System32\WindowsPowerShell\. Get a List of Windows PowerShell Modules Now execute the following command to display the location of each directory where these modules are stored at your computer: write-host "$PSModulePath" You can get a list of all available modules on your Windows system by ... Read more

Switch between English and German keyboard layouts on German keyboards (Windows)

Switch Windows Keyboard Layout

German keyboards are usually QWERTZ keyboards, named after the first row of letters to the first, which differs from the English layout, which is called QWERTY. You can switch between these two using the key combination Alt + Shift. This switch can be the cause of your keyboard behaving strangely - for example, if you ... Read more