PowerShell Array vs ArrayList [Complete Guide]

When working with collections of data in PowerShell, two common types are arrays and ArrayLists. Both serve the purpose of holding multiple items, but they have different characteristics and methods that can make one more suitable than the other, depending on the situation. In this post, we will look at the differences between arrays and … Read more

How to Sum All Numbers in an Array in PowerShell?

Sum All Numbers in an Array in PowerShell

Do you want to sum all numbers in a PowerShell array? In this PowerShell tutorial, I will explain how to sum all numbers in an array in PowerShell. To sum all numbers in an array in PowerShell, use the Measure-Object cmdlet with the -Sum parameter. For example, $total = ($array | Measure-Object -Sum).Sum will calculate … Read more

How to Join an Array into a String in PowerShell?

Join an Array into a String in PowerShell

In this PowerShell tutorial, I will explain how to join an array into a string in PowerShell using different methods with examples. To join an array into a string in PowerShell, you can use the -join operator. For example, $string = $array -join ‘,’ will concatenate all elements of $array into a single string, separated … Read more

How to Read Excel Files into an Array in PowerShell?

Recently, I got one requirement to read an Excel file into an array in PowerShell. In this PowerShell tutorial, I will explain to you how to read excel files into an array in PowerShell. To read Excel files into an array in PowerShell, you can use the ImportExcel module which simplifies the process of importing … Read more

How to Reverse An Array in PowerShell?

Reverse An Array in PowerShell

Recently, I wanted to reverse elements of an array in PowerShell. I tried three methods to achieve this. In this PowerShell tutorial, I will explain how to reverse an array in PowerShell. To reverse an array in PowerShell, use the array method .Reverse(). For example, $array.Reverse() will reverse the elements in place if $array is … Read more

How To Split Path Into Array In PowerShell?

How To Split Path Into Array In PowerShell

PowerShell provides the Split-Path Cmdlet to split path into an array. In this PowerShell tutorial, I will explain how to split a path into an array in PowerShell using different methods with examples. To split a file path into an array in PowerShell, use the Split-Path cmdlet in PowerShell. For example, to get the parent … Read more

How to Find the Highest Number in an Array in PowerShell?

How to Find the Highest Number in an Array in PowerShell

Today, I got a task to find the highest number in a PowerShell array. I used a few methods to achieve this. In this PowerShell tutorial, we’ll explore how to find the largest number in a PowerShell array using various methods and examples. To find the highest number in an array in PowerShell, use the Measure-Object cmdlet … Read more

How to Get Unique Values from an Array in PowerShell?

Get Unique Values from an Array in PowerShell

Do you need to retrieve unique values from a PowerShell array? This blog post will guide you through different methods to get unique values from an array in PowerShell. To get unique values from an array in PowerShell, use the Select-Object cmdlet with the -Unique switch. For instance, $uniqueArray = $array | Select-Object -Unique will … 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.