About 1,790,000 results
Open links in new tab
  1. How to initialize an array of custom objects - Stack Overflow

    May 10, 2017 · How can I create a similar structure of an array of custom objects, and initialize them in my script, without reading a file? I can do lots of looping and/or lots of …

  2. How to save each line of text file as array through powershell

    Sep 5, 2018 · In order to ensure that a command's output is always an array, PowerShell offers @(...), the array-subexpression operator, which wraps even single-object output in an array. …

  3. powershell - How to output arrays to text file? - Stack Overflow

    Aug 20, 2023 · You need to send $Array through the pipeline. Include the vertical bar. $Array | Out-File -Append c:\temp\Version.txt

  4. PowerShell Read File Into Array: A Simple Guide

    PowerShell's `Import-Csv` cmdlet simplifies reading CSV files and automatically structures the data into an array of objects for easy access. For example: $array = Import-Csv -Path …

  5. How To Read File Line By Line Into Array In PowerShell?

    Feb 8, 2024 · To read a file line by line into an array in PowerShell, use the Get-Content cmdlet which automatically returns an array of strings, with each line from the file as an element in the …

  6. PowerShell: How to Export an Array to a CSV File?

    Mar 31, 2021 · There are several ways to export an array to a CSV file in PowerShell. In this post, we will cover three methods: the Export-Csv cmdlet, Add-Content with a ForEach loop, and …

  7. How to Import CSV to Array in PowerShell?

    Jun 7, 2024 · To import CSV data into an array in PowerShell, use the Import-Csv cmdlet followed by the file path, which creates an array of objects from the CSV file. For example, $array = …

  8. How to Read CSV into Array in PowerShell? - SPGuides.com

    May 7, 2024 · PowerShell provides Import-Csv cmdlet to read CSV files and import the data into PowerShell as an array of custom objects. Each row in the CSV file becomes an object, and …

  9. PowerShell Create Array of Objects: A Quick Guide

    In PowerShell, you can create an array of objects by initializing an array and adding custom objects to it using the `New-Object` cmdlet or with the `PSCustomObject` type accelerator. …

  10. PowerShell: Turn Your Custom Objects into CSV Files (and vice …

    Aug 25, 2023 · In this blog post, I will show you how to export and import a custom object array to a CSV file with PowerShell, using different code examples and exploring all the parameters …

  11. Some results have been removed
Refresh