Ivan Mirchev profile picture

Follow Ivan

Ivan Mirchev

Petri Contributor

My name is Ivan Mirchev, IT Professional with more than 19 years of experience, specializing in Microsoft technologies and a PowerShell enthusiast. Ex-Microsoft PFE and PowerShell master trainer, currently working as a Senior Cloud engineer at KPMG ITS. Certified as Microsoft Certified Solutions Expert: Windows Server 2008/2012/2016, Microsoft Certified: Azure Solutions Architect Expert, and Microsoft Certified Trainer.

LATEST

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…

View Article
PowerShell

How to Write and Run a PowerShell Script File on Windows 11

Last Update: Dec 05, 2023

PowerShell is a command-line tool developed by Microsoft for automating common administrative tasks. A script is a collection of PowerShell commands, stored into a text file, with a *.ps1 file extension. When executing a PowerShell script, the interpreter reads the file and runs the commands sequentially. You can create a PowerShell script using any text…

View Article
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…

View Article
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…

View Article