Scripting
How to Delete Old PowerShell Modules
A function to check for all old versions of installed modules are remove them permanently to free up disk space ... [Read More]
How to Update All PowerShell Modules – All at Once
A one-liner to update all PowerShell modules installed from online repositories ... [Read More]
How to Run a Command Stored in a Variable | PowerShell
Use the & operator to execute the content of a variable in PowerShell ... [Read More]
Show Error Details – PowerShell
How to get verbose PowerShell error messages ... [Read More]
How to Test Open Port in PowerShell
Two ways to check open ports with PowerShell ... [Read More]
Easy Password Generator in PowerShell
Use PowerShell to generate randomized passwords in a length and count you want! ... [Read More]
PowerShell: How to parse a large one-line XML
Parse unformatted (one-liner) xml files, adding line breaks and indentation using Linux ... [Read More]
PowerShell: How to Reverse an Array
Learn how to reverse an array of any kind in PowerShell ... [Read More]
How Does UTF-8 Encoding Work
Learn what the UTF-8, UTF-16 and UTF-32 encodings are, how they work, what is BOM and how variable length encoding is utilized to represent over a 100 thousand characters in a simple text file ... [Read More]
How to Move Files from Multiple Subfolders to a Single Folder with PowerShell?
How to move all files that matches a pattern from subdirectories to a cetralized target location ... [Read More]
PowerShell: Extract Pattern from a String
Two methods of extracting text from an input string with PowerShell using regex expressions ... [Read More]
Regex tricks – Remove leading and trailing white spaces with Notepad++ and Vim
Learn how to remove leading and trailing whitespaces with either Notepad++ or Vim ... [Read More]
Grep command in PowerShell (recursive)
A simple function to mimic the Unix recursive grep command ... [Read More]
PowerShell – How to Decrypt a SecureString
Two ways to decrypt a SecureString in PowerShell ... [Read More]
Base64 Encode with Fixed Line Length Output in PowerShell
Here is an example script that encodes an arbitrary text with Base64 method using PowerShell and breaks up the output into fixed-length lines to make it more easily readable. We use 76 character long rows as the MIME (Multipurpose Internet ... [Read More]
Split a String Into Fixed Length Lines in PowerShell
A one-liner to split up a long string into fixed-length rows in PowerShell ... [Read More]
How to List the Total Size of a Folder with PowerShell
List the total size, the subfolder-count, and the file-count of a folder or subfolder in PowerShell ... [Read More]
PowerShell – How to add extra column to a CSV Export
Have you ever found yourself in a situation where you wanted to export the output of a PowerShell cmdlet or script, but needed to add an extra column to the output to export to a CSV file? Let's see how ... [Read More]
Random Password Generator in PowerShell
A one-liner to generate passwords with PowerShell. Specify the length and the characters that builds up the passwords and off you go! ... [Read More]
Script to Customize the look of a PowerShell Window
A PowerShell window looks pretty unified when it starts up. Especially if there are multiple windows open at the same time it might be helpful if they were distinguishable. Like a different color as the background, or a specific title ... [Read More]
Install-PackageProvider: No match found error when installing PowerShell modules | FIX !
The Issue PowerShell - Install-PackageProvider: No match found error when installing PowerShell modules | FIX ! In a new deployment of Windows Server 2016 or 2019 when using the Install-Module [xxx] command you might be prevented with the following error ... [Read More]
Regex tricks – Remove empty lines with Notepad++ and Vim
Quickie guide for removing empty lines with Notepad+ and Vim ... [Read More]
Regex tricks – Remove Commented Out Lines with Notepad++ or Vim
Both Notepad++ in Windows and Vim in unix-type machines are perfectly capable of using regular expressions which is a super handy tool in an admin's hands ... [Read More]
Storing Passwords for PowerShell Scripts – ALWAYS WORKS!
In case you cannot use the CredentialManager PowerShell module to store and retrieve user credentials, but you still need to securely store user passwords or other confidential data there is another way to do so. 1. Securely Encrypt and Store ... [Read More]
Base64 Encoder and Decoder Algorithm in PowerShell – with Examples
The idea of encoding and decoding to- and from Base64 using PowerShell is based on the very same algorithm as we used in our Python example. In this short article we go through the process of encoding and then decoding ... [Read More]
Base64 Encoder and Decoder Algorithm from Scratch in Python
In Python there is a built-in Base64 encoder/decoder ready to use. Here is a very simple example on how to encode and decode using the built-in base64 library ... [Read More]
Base64 Encoding Explained with Examples
Have you ever been wondering why SSL certificates have a strange code in their body, that seemingly only consists of letters, numbers, the "+" and the "/" characters? If you've ever checked the actual content of a saved email, the ... [Read More]
PowerShell Abbreviation Table
Have you ever wondered while typing the same long PowerShell command again and again, that there must be an abbreviation for at least a few of them? Here you go! ... [Read More]
How to SECURELY store credentials for PowerShell scripts
Every day we need to log into hundreds of portals, as it is important for security, there must be a way to script it, automate logins without putting our actual passwords in scripts in plain text, right? Luckily this is ... [Read More]
Math: X To The Power of Y in PowerShell
Math in PowerShell is very simple and straightforward, the basic operators work as they usually do in any programming or scripting language: 1 + 1, 64 - 16, 4 * 32, 1024 / 128, etc. However, many times I faced ... [Read More]
