About 50 results
Open links in new tab
  1. PowerShell array initialization - Stack Overflow

    Oct 22, 2008 · Creating an array with the range operator n..m is 10x slower (200k ticks). Using an ArrayList with the Add() method is 1000x slower than the baseline (20M ticks), as is looping through …

  2. powershell - Array.Add vs += - Stack Overflow

    Jan 31, 2013 · I personally use += and array 99% of the time because I usually create short throw-away scripts where the extra seconds doesn't matter. For big scripts with lots of add/remove where I want …

  3. How to initialize a large, multi-dimensional array in Powershell?

    Oct 18, 2021 · I've yet to find a solution which covers how to both declare AND initialize a multi-dimensional array. In my case, I need an array [10] [10] with all elements initialized to zero.

  4. How do I create array of arrays in PowerShell? - Stack Overflow

    Jun 21, 2012 · How do I create array of arrays in PowerShell? Asked 13 years, 7 months ago Modified 7 years, 1 month ago Viewed 57k times

  5. 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 creating/initializing individual …

  6. PowerShell copy an array completely - Stack Overflow

    Apr 17, 2015 · I'm trying to create a complete copy of an existing array. Every time I try this it doesn't seem to work. The thing is that I'm modifying the object names inside the new copied array, but …

  7. How create multidimensional dynamic array in powershell

    Jul 4, 2019 · How create multidimensional dynamic array in powershell Asked 6 years, 7 months ago Modified 6 years, 7 months ago Viewed 2k times

  8. how to create and populate 2-dimensional array in PowerShell?

    Jul 12, 2016 · how to create and populate 2-dimensional array in PowerShell? Asked 9 years, 7 months ago Modified 2 years, 3 months ago Viewed 18k times

  9. Creating an array with large initial size in powershell

    Mar 29, 2017 · In PowerShell you are correct in that += will destroy the old array and create a new array with the new items. For working with a large collection of items i would highly recommend using the …

  10. ConvertTo-JSON an array with a single item - Stack Overflow

    Actually the pipeline approach was wrong in the first place, arrays are always iterated when passed to the pipeline. Just luckily the behavior of ConvertTo-Json is to collect all pipeline input in an array and …