“Foreach Powershell” Code-Antworten

Foreach Powershell

ForEach($user in $users){
	Write-Output $user
}
Unusual Unicorn

Powershell foreach

$Items = "A", "B", "C"
#There are 2 ways to do this.
#The Foreach Keyword
foreach ($item in $items) {
	Write-host $Item
}
#OR By Piping 
#$_ is a dedicated varible for the object in the Pipe
$Items | Foreach-Object {
	Write-host $_
}
Arrogant Antelope

PowerShell für jede Schleife

> $array = @("item1", "item2", "item3")
 
> foreach ($element in $array) { $element }
item1
item2
item3
 
> $array | foreach { $_ }
item1
item2
item3
Delta Sierra

Ähnliche Antworten wie “Foreach Powershell”

Fragen ähnlich wie “Foreach Powershell”

Weitere verwandte Antworten zu “Foreach Powershell” auf Shell/Bash

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen