• Remove Item from Array in PowerShell
    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-6642acacc8a2c115250084/] [crayon-6642acacc8a3e197753329/] 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-6642acacca9fd433832289/] [crayon-6642acaccaa09139836336/] 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 […]