Array in Windows PowerShell Scripts
What is an array in Windows PowerShell scripts?
An array in Windows PowerShell is a simple data structure where pieces of data are stored in as elements in the structure in an ordered sequence. In an array, each element can be identified by the sequence index.
You can create an array of objects by listing its elements using the @(...) syntax as shown below:
For example, the following script creates an array of String objects and assign it to variable $w:
$w = @("Sun","Mon","Tue","Wed","Thu","Fri","Sat") "Week Days:" $w
You can access a member of an array variable using the "[n]" operation, where "n" is the sequence index where the member is located in the array:
$w = @("Sun","Mon","Tue","Wed","Thu","Fri","Sat") "First day of the week is "+$w "Last day of the week is "+$w
2016-10-29, 473👍, 0💬
How to remove msjava.dll - Java Console Extra Tools Menu Item for Internet Explorer (IE) browsers? m...
How do I move the licenses for the songs that I purchased from an online store to my new computer? T...
Can I remove startup application "ISUSPM.exe - InstallShield Update Service Update Manager" to speed...
How to block popup ads in Mozilla FireFox 2? If you are getting a lots of popup ads, and want to blo...
What files are used by Windows Live Toolbar for Internet Explorer (IE) browser? How Alexa Toolbar is...