PowerShell Array
- 07 February
PowerShell – Remove Item from Array
Please note that we will use ArrayList instead of Array here as Array is fixed size and it can not be altered. Using Remove() Method Use the Remove() method to eliminate an item from an ArrayList in PowerShell. [crayon-67680cbd791cd228462475/] [crayon-67680cbd791d4416507743/] In the above example, the courses titled Maths, Chemistry, and Physics are added to an […]
- 26 December
Remove Duplicates from Array in PowerShell
Using Select-Object with the -Unique Parameter To remove duplicates from array in PowerShell: Use the array operator to create an array having duplicate values. Use the Select-Object with the -Unique parameter to select unique values from the array we created in the previous step. [crayon-67680cbd7945a342626581/] [crayon-67680cbd7945e639921818/] For this code, we used the array operator (@()) […]
- 16 December
Write Array to CSV in PowerShell
This article will explain how to write an array to a CSV file in PowerShell. Using the Export-Csv cmdlet The Export-Csv cmdlet in PowerShell creates a CSV file of the given objects. But you cannot directly write an array to a CSV file correctly. When you pipe the array to Export-Csv, the result will be […]