How to Get Current Directory in PowerShell?

powershell get current directory

In a training session, someone asked me about retrieving the correct directory in PowerShell. This is a very common requirement for PowerShell developers. In this tutorial, I will explain how to get the current directory in PowerShell using different methods with examples. To get the current directory in PowerShell, you can use the Get-Location cmdlet. … Read more

How to Prompt for Input in PowerShell?

powershell prompt for input

When working with PowerShell, there are several occasions when you need to prompt the user for input. This is, in fact, a very common requirement among PowerShell developers. In this tutorial, I will explain various methods to prompt for user input in PowerShell with examples. To prompt for user input in PowerShell, you can use … Read more

Get-ChildItem in PowerShell

powershell get-childitem

As a PowerShell developer, you might use Get-ChildItem cmdlet in your daily life. In this tutorial, I will explain how to work with Get-ChildItem cmdlet in PowerShell. To filter files larger than 1MB using PowerShell’s Get-ChildItem, you can combine it with Where-Object. For example, the command Get-ChildItem -Path “C:\Users\JohnDoe\Documents” -File | Where-Object { $_.Length -gt … Read more

How to Set Execution Policy in PowerShell?

set execution policy in powershell

If you’re working with PowerShell scripts on your Windows computer, you’ll likely need to adjust the execution policy at some point. The execution policy determines the conditions under which PowerShell loads configuration files and runs scripts. In this tutorial, I will explain how to set the execution policy in PowerShell with the complete script. To … Read more

How to Wait for a Command to Finish in PowerShell?

How to Wait for a Command to Finish in PowerShell

As a PowerShell developer, you will like this tutorial. PowerShell is used to automate tasks and manage systems. However, sometimes, you need to ensure that one command completes before another starts. In this tutorial, I will explain how to wait for a command to finish in PowerShell with examples. To make PowerShell wait for a … Read more

How to Add Value to an Array in a Function in PowerShell?

add value to array in function in powershell

In one of my previous tutorials, I explained how to add values to a PowerShell array using various methods. But today, I will show you an advanced method. In this tutorial, I will explain how to add values to an array in a PowerShell function with examples. To add a value to an array within a function in … Read more

How to Add Values to a Multidimensional Array in PowerShell?

powershell add values to multidimensional array

One of my team members recently asked to add values to a multidimensional array in PowerShell. There are various methods to do so. In this tutorial, I will explain how to add values to a multidimensional array in PowerShell. I will also show how to add values to 2-dimensional array in PowerShell. To add values … Read more

How to Add Only Unique Values to an Array in PowerShell?

Add Only Unique Values to an Array in PowerShell

While working with arrays in PowerShell, I was required to add only unique values. There are various methods to do so. In this tutorial, I will explain how to add unique values to an array in PowerShell with examples. To add only unique values to an array in PowerShell, use a conditional check with the … Read more

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.