PowerShell

About PowerShell

PowerShell is a robust scripting language and command-line shell developed by Microsoft. Originally developed for Windows, it is now a cross-platform language. Serving as a task automation framework, PowerShell lets you manage and automate the administration of systems and processes. Using .NET objects and classes, it offers a lot of flexibility and functionality compared to traditional VBScript and DOS, scripting methods traditionally used on Windows.

Let the PowerShell category page be your guide to scripting excellence, as you enhance your skill set and optimize your workflow.

FUNDAMENTALS

PowerShell

What is PowerShell and How to Get Started With It?

Last Update: Mar 22, 2024

PowerShell is a cross-platform object-oriented language and shell that IT pros can use to manage computers running Windows, Linux, and macOS. PowerShell can automate tasks across thousands of computers simultaneously. If you’ve ever wondered what PowerShell is and what it’s for, this article aims to answer some of the most common questions you may have…

PowerShell

IT Expert Answers: How to Check Your PowerShell Version

Last Update: Jul 03, 2024

Whether you’re a PowerShell pro or just starting out, it’s useful to know how to check your PowerShell version. We’ll explain how to do that in this guide. How to check your PowerShell version Let’s quickly check the version of PowerShell installed on your device: For more details on the different ways to check the…

PowerShell

PowerShell Set Environment Variable – A Step-By-Step Guide

Last Update: Jan 30, 2024

Environment variables are essential for accessing command line tools and controlling program execution in operating systems. In Windows, PowerShell provides a convenient way to manage and access environment variables. You can set the environment path, edit existing paths, and handle the user profile on your computer. In this step-by-step guide, we’ll explore what environment variables…

GETTING STARTED

PowerShell

How to Use PowerShell Grep: Select-String and RegEx Real World Examples

Last Update: Sep 04, 2024

Grep (Global Regular Expression Print) is a commonly used Linux command for searching strings of characters in text files. There’s is no such thing as PowerShell grep. But naturally, you can get the same functionality in PowerShell. You’ll just need to use the Select-String cmdlet instead. In this article, I’ll show you how to get…

PowerShell

How to Use a PowerShell Foreach Loop

The PowerShell Foreach statement is useful when working with collections of items. It can be used to execute a command or a set of commands for each item in a collection. In this article, I will explain three different ways to use the Foreach keyword: the Foreach loop, the ForEach object cmdlet, and the ForEach…

PowerShell

How to Connect to Exchange Online Using PowerShell

Last Update: Dec 05, 2023

Exchange Online PowerShell is a command-line tool that allows you to manage your Exchange Online mailboxes and users. It can be used to perform a variety of tasks, such as creating and managing mailboxes, configuring mail flow rules, and managing user permissions. In this guide, we’ll show you how to install and connect to Exchange…

TUTORIALS

PowerShell

Filtering with PowerShell Where-Object: Easy Examples

Last Update: Oct 16, 2023

In this article, I’ll explain how to use the PowerShell Where-Object cmdlet to filter objects and data. I’ll provide a series of easy examples showing you how to filter files by name or date, how to filter processes by status or CPU usage, and more. When using PowerShell, you will often receive an extremely large…

PowerShell

How to Use the PowerShell Exit Keyword to Terminate Scripts

Last Update: Jul 31, 2023

PowerShell’s built-in exit keyword allows you to terminate scripts without closing your PowerShell session. There are different ways to use PowerShell exit to break the execution of a script, function, loop, or switch statement. But it’s important to understand how the exit keyword works if you want to use it effectively. In this guide, I…

PowerShell

How to Use PowerShell For Loop, While Loop, and Other Loops

Last Update: Mar 13, 2024

In this article, we will review PowerShell For loops, While loops, Do-While loops, and Do-Until loops. I’ll explain how PowerShell loops are constructed and how to define conditions to enter or exit a loop. PowerShell For loop The For loop is а counting loop, and it’s mostly used when you need to repeat a task…

PowerShell

How Can I Move a File or Folder from the Command Line Using Windows PowerShell?

Last Update: Sep 04, 2024

In this article, I’ll show you how to use Windows PowerShell to move one or multiple files or folders from the command line, using the Move-Item, Get-Item, and Get-ChildItem PowerShell cmdlets. If you would like to delete a file or folder using PowerShell, check out How Can I Delete a File or Folder from the…

LATEST

1725501059 powershell hero

Microsoft Releases PowerShell Script to Counter BlackLotus UEFI Bootkit Threat

Microsoft has released a new PowerShell script that enables administrators to update bootable media with the “Windows UEFI CA 2023” certificate to boost system security. This update specifically targets vulnerabilities exploited by the BlackLotus UEFI bootkit, which is a sophisticated threat capable of bypassing Secure Boot protections. What is BlackLotus UEFI? BlackLotus UEFI is a…

PowerShell

How to Use PowerShell If Statements to Add Conditional Logic to Your Scripts

Last Update: Dec 03, 2024

PowerShell is a powerful scripting language for many reasons. One such reason is its support for conditional logic, which can help you supercharge your PowerShell scripts to make them even more efficient and effective. In this article, I’m going to teach you how to use If, Else, and Elseif conditional logic and explain how this…

PowerShell

How to Find a Substring In PowerShell

Last Update: Nov 13, 2024

Need to search for or extract a substring inside a PowerShell string? Never fear, PowerShell substring is here! In this article, I guide you through how to ditch objects and search inside strings. The PowerShell substring Although you’ll hear me go on and on about object in the pipeline, there’s nothing wrong with parsing strings…

PowerShell

Mastering the PowerShell Trim Method

Last Update: Nov 18, 2024

This guide explores the PowerShell Trim methods in detail, with real-world examples and practical tips on how to use each method effectively in PowerShell scripts. Effective string handling in PowerShell is a cornerstone of clean, efficient scripting, especially when handling user input, log data, or file paths. In PowerShell scripting, precision in string manipulation is vital for cross-platform efficiency, making methods like Trim, TrimStart, and TrimEnd indispensable tools for…

1725501059 powershell hero

PowerShell Classes – Your Ultimate Guide

Last Update: Sep 11, 2024

Take your PowerShell programming to a new level by learning how to use classes.

Cloud Computing

Windows Autopatch Adds PowerShell Scripts Support for Automated Policy Conflict Resolution

Microsoft has rolled out a new update that enables administrators to use PowerShell scripts with Windows Autopatch to resolve policy conflicts more efficiently. Windows Autopatch is a cloud-based service that helps organizations automate the update process for Windows, Microsoft 365 Apps for Enterprise, Microsoft Edge, and Microsoft Teams. What causes policy conflicts? Microsoft explains that…

PowerShell

Use PowerShell Functions to Quickly Simplify Your Scripts

Last Update: Jul 15, 2024

Are you creating PowerShell scripts for the first time? One important skill to master is how to write PowerShell functions, which work as a block of code that you can easily reuse. In this article, you will learn about the basics of building your first function and how to call it when you need it….

PowerShell

How to Add Comments to Your PowerShell Code and Scripts

Last Update: Nov 19, 2024

In this guide, you will learn about using PowerShell comments to help you better document your code and provide comment-based help capabilities for your PowerShell functions. By the end of this guide, you will be proficient and immediately effective at creating PowerShell comments to enhance readability and create documentation for your PowerShell scripts. Ready? Let’s…

Security

Microsoft Entra PowerShell Module: Streamlining IT Resource Management and Automation

Microsoft has recently announced the public preview of its Entra PowerShell module, a new command-line tool designed for IT administrators. This module enables the programmatic management and automation of Microsoft Entra resources, streamlining administrative tasks and enhancing efficiency. The new Microsoft Entra PowerShell module is built on and fully interoperable with the Microsoft Graph PowerShell…

PowerShell

IT Expert Answers: How to Check Your PowerShell Version

Last Update: Jul 03, 2024

Whether you’re a PowerShell pro or just starting out, it’s useful to know how to check your PowerShell version. We’ll explain how to do that in this guide. How to check your PowerShell version Let’s quickly check the version of PowerShell installed on your device: For more details on the different ways to check the…

PowerShell

5 Easy Ways to Install PowerShell 7 on Windows

Last Update: Mar 22, 2024

Looking to install the latest version of Powershell? Here’s the tutorial to install the latest version of the platform.

PowerShell

What is PowerShell and How to Get Started With It?

Last Update: Mar 22, 2024

PowerShell is a cross-platform object-oriented language and shell that IT pros can use to manage computers running Windows, Linux, and macOS. PowerShell can automate tasks across thousands of computers simultaneously. If you’ve ever wondered what PowerShell is and what it’s for, this article aims to answer some of the most common questions you may have…

Go to page