PowerShell Basics: Data, Loops and Conditions

 

Powershell arrays and objects and logic: If queries and loops.

PowerShell if else and switch

PowerShell if else and switch

created: 2022-05-02 from Bernhard

Test conditions with the commands if, elseif, else and switch and execute a command if they apply: if, else, ... then ... continue reading

PowerShell Loops and Array

PowerShell Loops and Array

created: 2022-05-02 from Bernhard

An array stores multiple values, similar to a 2-column table. ... continue reading

PowerShell Hashtable vs Array vs Dictionary

PowerShell Hashtable vs Array vs Dictionary

created: 2022-05-02 from Bernhard

If you want to store specific values for an array, you will reach the limits with arrays. A hashtable is similar to an array, but stores a value for each entry. (similar to the vbscript: Dictionary) ... continue reading

PowerShell own objects

PowerShell own objects

created: 2023-08-24 from Bernhard

PowerShell cmdlets very often create an object or an object array (multiple objects in an array). In this post, I show how to create objects themselves and add properties to them. ... continue reading

Create, allow and run a Windows PowerShell Script | PowerShell | PowerShell editors in comparison: ISE, Visual Studio Code

Top articles in this section


PowerShell Log-Files: Logging into a textfile - write to file

Log files in PowerShell can be created via the Out-File command, via a custom function, or via PowerShell's built-in Transcript.


PowerShell: Prevent screen saver, lock: Move mouse regularly

Alternatively, if you can't change the screen lock settings, you can move the mouse regularly, or have a script move the mouse. Originally published as an AutoIt script, I recreated the script with a few PowerShell lines. Anyone who copies the following commands into a PowerShell session will prevent the computer from locking the screen or starting the screensaver:


PowerShell TCP Listener

PowerShell uses the following commands to open a socket on a specific port via System.NET: