This blog discusses how we can use PowerShell to monitor CPU and memory usage. I was having a few issues recently on a web server whereby the server was becoming unresponsive due to either high CPU or memory usage. It … Continue reading →
Have you ever seen the PowerShell Add-Content error The Process Cannot Access The File? I stumbled upon it a while ago when I wrote a simple PowerShell logging function. Originally the script used the Add-Content cmdlet to write and append … Continue reading →
This blog explains setting a timeout in PowerShell scripts to prevent hanging. There’s nothing worse than iterating through a list of commands and the whole workflow grinds to a halt because one command is hanging. But resolving the issue is … Continue reading →
This blog post provides an example of how we can call a PowerShell function in another PowerShell script. Let’s first assume that we have a function in a script called AlkaneFunctions.ps1 that enables us to install an MSI using PowerShell … Continue reading →
This blog post explains using PowerShell bitwise comparison operators to check and set bit flags. You can also use PowerShell to calculate bit flags by creating your own enum if desired. We must first start with a (really) basic primer … Continue reading →
Sometimes we want to blind copy (BCC) a group of users into an email, without specifying the To address. In this blog post we find a solution to send bulk emails with PowerShell using only BCC. In an earlier post … Continue reading →
Command-line arguments allow us to pass information to our scripts dynamically, making them more flexible and versatile. In this blog post, we’ll explore handling command-line arguments in PowerShell. Handling Command-Line Arguments in PowerShell Using Args When we execute a PowerShell … Continue reading →
In this blog post, we’ll explore how to comment out code in PowerShell using both single-line and multi-line comments. Single-Line Comments Single-line comments are used to annotate a single line of code in PowerShell. These comments are helpful when we … Continue reading →
The “Do While” and “Do Until” loops provide valuable options for executing code based on specified conditions. In this blog post, we’ll dive into using the PowerShell Do While loop and Do Until loop, their syntax, and how we can … Continue reading →
One of the essential looping constructs in PowerShell is the “For” loop. In this blog post, we’ll delve into using the PowerShell For loop, its syntax, and how we can utilise it effectively in our scripts. Understanding the For Loop … Continue reading →