Beginner
For those just dipping their toes into the PowerShell waters.
-
Part 1: Understanding PowerShell Profiles — Your Personalized Command-Line Workspace PowerShell is incredibly powerful out of the box, but one of its best features is often overlooked: PowerShell profiles. A PowerShell profile allows you to automatically configure your shell every time it starts. Think of it as a startup script for PowerShell. Instead of repeatedly defining aliases, importing modules, or tweaking your prompt, you can save those customizations in a profile and have them loaded automatically.…
-
Learn how to calculate the maximum depth of a JSON object in PowerShell using a recursive approach. This article explains the logic behind the Get-JsonDepth function, discusses why arbitrary depth limits should be avoided, and explores the balance between accuracy, maintainability, and performance when traversing complex object graphs.
-
Storing credentials in plain text within scripts is a common but risky practice. While it may seem convenient for automation, it exposes sensitive data to anyone with access to the code. In this article, we explore a safer approach using PowerShell’s ConvertTo-SecureString and ConvertFrom-SecureString to encrypt passwords tied to a specific user and machine. This method significantly reduces the risk of credential leaks while keeping automation seamless.
-
When automating tasks on Windows, PowerShell scripts often handle the heavy lifting—but automation isn’t complete until those scripts run on their own. While many admins still use the graphical Task Scheduler, PowerShell provides a full set of cmdlets that make creating, managing, and automating scheduled tasks easier, faster, and more repeatable. In this guide, we’ll walk through how to schedule PowerShell scripts entirely through PowerShell using cmdlets like New-ScheduledTaskAction, New-ScheduledTaskTrigger, and Register-ScheduledTask. We’ll also explore best practices, logging,…
-
Have you ever written a script that worked perfectly in testing, only to cause chaos in production? I have, and it was one of the most stressful days of my career. This experience changed how I write scripts. More checks, fewer assumptions, and no blind trust in defaults.
-
Choosing between -match and -like depends on the complexity of your pattern matching. Use -like for simple wildcard checks, such as finding strings that contain certain characters (* and ? are your friends). When you need more power, like anchoring patterns, grouping, or advanced conditions, reach for -match, which leverages regular expressions. In short: -like is quick and simple, -match is precise and flexible.
-
Tired of manually downloading LEGO building instructions? This PowerShell function automates the process by fetching the instruction page, filtering valid PDF links, and saving them neatly into a folder per set. Whether you’re organizing your collection or just love scripting, this tool adds efficiency and fun to your LEGO hobby.
-
Measure-Command is a simple yet powerful tool to gain insight into the performance of your PowerShell code. Whether you’re optimizing scripts or just curious — to measure is to know.
-
One of PowerShell’s most powerful features is its pipeline system. The pipeline allows you to send output from one command directly to the input of another command, creating efficient and elegant solutions to complex problems. In this guide, we’ll explore how to master PowerShell’s pipeline to write more efficient and readable scripts. What is the PowerShell Pipeline? The PowerShell pipeline is represented by the pipe symbol (`|`) and allows you to chain commands together. Unlike…
-
Master everyday file and directory tasks in PowerShell with a practical toolkit: navigate with Set-Location (cd/$pwd), explore with Get-ChildItem (filters, recursion, attributes), create with New-Item, and manage with Copy-Item, Move-Item, and Remove-Item. Learn safe patterns using Test-Path, -WhatIf, and Join-Path, plus real-world scripts for backups, temp cleanup, organizing files by extension, and detecting duplicates. The article also covers error handling and cross-platform path practices to keep automation reliable.
