Bootstrap FreeKB - PowerShell - Getting Started with Lists
PowerShell - Getting Started with Lists

Updated:   |  PowerShell articles

Here is how you would create a list that contains a few items.

$mylist = @("apple","banana","orange","grapes")

foreach ($item in $mylist) {
  Write-Host "item = $item"
}

 

Which should print the following.

item = apple
item = banana
item = orange
item = grapes

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 074473 in the box below so that we can be sure you are a human.