Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Change Value of Element in PowerShell Array

$
0
0

Summary: Learn how to change the value of an element in a Windows PowerShell array.

Hey, Scripting Guy! Question How can I use Windows PowerShell to change the value of the first element in an array?

Hey, Scripting Guy! Answer Use the Set method and specify the element number and the new value, for example:

PS C:\> $a = 1,2,3,4,5

PS C:\> $a.Set(0,50)


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>