RosettaCodeData/Task/Find-limit-of-recursion/PowerShell/find-limit-of-recursion.ps1
2026-04-30 12:34:36 -04:00

15 lines
233 B
PowerShell

function TestDepth ( $N )
{
$N
TestDepth ( $N + 1 )
}
try
{
TestDepth 1 | ForEach { $Depth = $_ }
}
catch
{
"Exception message: " + $_.Exception.Message
}
"Last level before error: " + $Depth