Category - PowerShell
Here you will find all the articles related to PowerShell that I have written. Just scroll or browse through the different posts or use the search function in the top right corner. I have highlighted 3 articles for you that are definitely worth reading.

How to use PowerShell Variables
Variables in PowerShell are used to store values, data, or other information you need later in your script. They can also used to capture the results of a cmdlet. But ... Read moreHow to use PowerShell Variables

PowerShell ForEach-Object and ForEach Loop Explained
PowerShell ForEach and ForEach-Objects loops are one of the most commonly used functions. They allow you to easily iterate through collections. But what is the difference between ForEach-Object and the ... Read morePowerShell ForEach-Object and ForEach Loop Explained

How to Trim a string in PowerShell
Do you need to remove the trailing spaces of a string? Or a character for the beginning or the end of a string in PowerShell? Then the Trim function in ... Read moreHow to Trim a string in PowerShell

How to add a Comment in PowerShell
When writing code in any language it’s important to add comments. This also applies to your PowerShell scripts. Although they may sometimes be short, adding comments in PowerShell is nevertheless ... Read moreHow to add a Comment in PowerShell

How to Pause in PowerShell
PowerShell is a great way to automate tasks or processes, like creating users. But sometimes during such a task or process, you need to pause the script. For example to ... Read moreHow to Pause in PowerShell

How to Send Email with Powershell
PowerShell is a great tool to automate tasks and create reports or exports, but at some point, you want to send an email with PowerShell. Maybe when a task failed ... Read moreHow to Send Email with Powershell

How to Create a PowerShell Scheduled Task
PowerShell scripts are a great way to automate daily tasks or generate weekly reports. But how do you make a scheduled task for your PowerShell scripts? We can do this ... Read moreHow to Create a PowerShell Scheduled Task

How to Split a String in PowerShell
In PowerShell, a pretty common task is to split a string into one or more substrings. Splitting a string is always done based on a delimiter. This can be pretty ... Read moreHow to Split a String in PowerShell

How to Create a File in PowerShell
In PowerShell, there are a couple of ways to create a file. The most common method is to use the new-item cmdlet. This cmdlet can not only be used to ... Read moreHow to Create a File in PowerShell

How to use Connect AzureAD in PowerShell
The Azure AD PowerShell module allows you to manage your Azure Active Directory with PowerShell. The first step to use this module is to use the Connect-AzureAD cmdlet. After you ... Read moreHow to use Connect AzureAD in PowerShell

Connect-PnPOnline – How to Manage SharePoint Online with PowerShell
SharePoint comes with some templating options, but when you want to quickly roll out a new SharePoint with predefined libraries, for example, then using PowerShell is your best option. To ... Read moreConnect-PnPOnline – How to Manage SharePoint Online with PowerShell

How to use PowerShell Invoke-Command
Do you want to run a PowerShell command on a remote computer or server? Then you don’t need to open a remote desktop connection, because you can just use the ... Read moreHow to use PowerShell Invoke-Command

How to use PowerShell Select-Object
When retrieving data with PowerShell you often need only a few of the properties of an object. To do this we can use the cmdlet Select-Object, which allows us to ... Read moreHow to use PowerShell Select-Object

How to use PowerShell Where Object
When retrieving data with PowerShell you often only need a part of it. This is where the PowerShell Where Object cmdlet comes in. It allows you to select only the ... Read moreHow to use PowerShell Where Object

How to use Powershell Write Host
The PowerShell Write-Host cmdlet is used to output text to the console for the user. It’s commonly used to show the progress of a script, output results, or show instructions ... Read moreHow to use Powershell Write Host

How to Create a Folder in PowerShell
Creating new folders from command line tools has always been possible in Windows. We could use the command mkdir in the old command prompt. But how do you create a ... Read moreHow to Create a Folder in PowerShell

How to Rename Files with PowerShell with Rename-Item
Renaming a single file can best be done in Explorer, but what if you need to rename multiple files? Then it’s better to use PowerShell to rename the files. With ... Read moreHow to Rename Files with PowerShell with Rename-Item

How to use PowerShell Get ChildItem Cmdlet
The PowerShell Get ChildItem cmdlet retrieves the child items from the specified location(s). The cmdlet is mainly used to retrieve files and folders, but it can also be used to ... Read moreHow to use PowerShell Get ChildItem Cmdlet

How to Update PowerShell Quickly
Keeping your PowerShell version up-to-date makes sure that you can use the latest features and cmdlets in your scripts. But how do you update PowerShell? There are two versions of ... Read moreHow to Update PowerShell Quickly

How to use the PowerShell Switch Statement
The PowerShell Switch statement allows you to test against multiple conditions. You can compare the switch statements with multiple if statements, only in a simpler and cleaner way. What most ... Read moreHow to use the PowerShell Switch Statement

How to Delete a File with PowerShell Remove-Item
Deleting files and cleaning up directories can be a time-consuming task, especially when you need to perform the same task on multiple computers regularly. But with PowerShell, we can create ... Read moreHow to Delete a File with PowerShell Remove-Item

How to use PowerShell If Else Statements
If-Else statements are the basis of any programming language, also in PowerShell. They are used to test if a condition is met, allowing you to perform different actions based on ... Read moreHow to use PowerShell If Else Statements

How to use Test-Path cmdlet in PowerShell
When working with files or folders in PowerShell, it’s important to test if the path exists, before you try to read or save contents. This is where the Test-Path cmdlet ... Read moreHow to use Test-Path cmdlet in PowerShell

How to use PowerShell Get-Content to Read a File
The Get-Content cmdlet can be used to retrieve the contents from a file in PowerShell. It will retrieve the contents one line at a time, storing them in an array. ... Read moreHow to use PowerShell Get-Content to Read a File

How to Use PowerShell Array – Complete Guide
PowerShell Arrays are used to store a collection of items. They are a fundamental part of PowerShell, or any programming language because they allow you to store and structure a ... Read moreHow to Use PowerShell Array – Complete Guide

How to Concatenate a String in PowerShell
When outputting data from PowerShell you often need to concatenate two or more strings or variables. Joining strings in PowerShell is primarily done using the + operator. But there are ... Read moreHow to Concatenate a String in PowerShell

Get-Date – How to get and use Dates in PowerShell
With Get-Date we can get the current date and time which is often used in PowerShell scripts to timestamp the output or in combination with logging. But besides timestamping, we ... Read moreGet-Date – How to get and use Dates in PowerShell

How to fix “Running Scripts is Disabled on this System”
Trying to run a PowerShell script, and do you get the error “Cannot be loaded because running scripts is disabled on this system”? Then we need to change the execution ... Read moreHow to fix “Running Scripts is Disabled on this System”

PowerShell Scripting – Get started with this Ultimate Guide
Automating daily tasks, extracting information from systems, or managing Microsoft 365? PowerShell scripts really make your daily work a lot easier. When you are working in IT then you can’t ... Read morePowerShell Scripting – Get started with this Ultimate Guide

How to use Get-Mailbox in PowerShell
Want to export all mailboxes from Exchange? Or need to look up the mailbox settings from a particular user? With the cmdlet Get-Mailbox in PowerShell, we can quickly extract all ... Read moreHow to use Get-Mailbox in PowerShell

PowerShell HashTable – Everything you need to know
Hashtables in PowerShell can be used to store information in a structured manner. This is done by using key/value pairs allowing you to easily extract the needed information from the ... Read morePowerShell HashTable – Everything you need to know

35+ PowerShell Commands you Must Know
PowerShell is a scripting language designed for system administration by Microsoft. These days, PowerShell can be used on multiple platforms and is used to perform or automate a wide range ... Read more35+ PowerShell Commands you Must Know

How to use Get-ADGroup in PowerShell
Do you need to get all the groups in your Active Directory or just need to find the location of the one group that is hiding somewhere in an OU? ... Read moreHow to use Get-ADGroup in PowerShell

How to Add or Set MailboxFolderPermission with PowerShell
In Exchange Online we can share whole mailboxes with other users. But what if you want to share only a folder? Or only the calendar in Outlook? We can set ... Read moreHow to Add or Set MailboxFolderPermission with PowerShell

Get MFA Status of Office 365 users with Microsoft Graph
Keeping track of your user’s MFA Status is important to keep your tenant protected. For now, we can still use the Msol module for this in PowerShell, but Microsoft is ... Read moreGet MFA Status of Office 365 users with Microsoft Graph

How to use Get-ADComputer in PowerShell
Need to export all computers from an OU, or look up a computer in your Active Directory? Or do you want to count how many computers you have? We can ... Read moreHow to use Get-ADComputer in PowerShell

How to use PowerShell String Contains
The Contains operator in PowerShell is a bit of a strange one. You probably want to check if a string contains a particular word or character. The -contains operator sounds ... Read moreHow to use PowerShell String Contains

How to Copy a File in PowerShell with Copy-Item
We can use PowerShell to copy a file from one location to another with the Copy-Item cmdlet. The location can be another local folder or a remote computer. Besides files, ... Read moreHow to Copy a File in PowerShell with Copy-Item

Set-Mailbox – Change Mailbox settings with PowerShell
The Set-Mailbox cmdlet in PowerShell allows us to change mailbox settings in Exchange Server and Exchange Online. We can use the cmdlet for example to change mailbox quotas, add an ... Read moreSet-Mailbox – Change Mailbox settings with PowerShell

New-PSDrive – How to use PowerShell Net Use alternative
We all know the Net Use command that we can use to map network drives from the command line. Although we can use Net Use in PowerShell, there is a ... Read moreNew-PSDrive – How to use PowerShell Net Use alternative

How to Create a New Local User with PowerShell
When you need to create a local user in Windows 10 or 11 you can use the User Accounts control panel. But we can also use PowerShell to create a ... Read moreHow to Create a New Local User with PowerShell

How to Add User to Group in PowerShell with Add-ADGroupMember
When you need to add multiple users to an Active Directory group then using PowerShell is really your best option. Instead of looking up all the users manually, you can ... Read moreHow to Add User to Group in PowerShell with Add-ADGroupMember

