$s="Juku" write-host $s function proov($sisend1, $sisend2){ $sisend1*$sisend2 } proov 5 10 function paev($x=(Get-Date).Date){ (Get-Date $x).DayOfYear } paev Get-Date (Get-Date).DayOfWeek function arvutamine([int] $x=2, [int] $y=8){ $x*$y } arvutamine arvutamine 3 5 arvutamine 4.4 5.5 function arvutamine2{ param($x=5, $y=6) $x*$y } arvutamine2 arvutamine2 3 4 arvutamine2 -y 3 -x 4 $jada=1, 2, 3, 4, 5, 6 $jada $jada | ForEach{Write-Host $_} ForEach($v in $jada){Write-Host $v} function ruut($parameeter){ [math]::pow($parameeter, 2) } $jada | ForEach{Write-Host(ruut($_))} For($i=0; $i -lt 5; $i++){ Write-Host $i } $i=0 While($i -le 5){ Write-Host $i $i++ } $i=0 Do{ write-host $i $i++ }While($i -lt 5) $i=0 Do{ Write-Host $i $i++ }Until($i -gt 5)