RosettaCodeData/Task/Repeat/PowerShell/repeat.ps1
2026-04-30 12:34:36 -04:00

14 lines
242 B
PowerShell

function Out-Example
{
"Example"
}
function Step-Function ([string]$Function, [int]$Repeat)
{
for ($i = 1; $i -le $Repeat; $i++)
{
"$(Invoke-Expression -Command $Function) $i"
}
}
Step-Function Out-Example -Repeat 3