PowerShell_Scripts/Get-ScopeDepth.ps1

3 řádky
129 B
PowerShell

$local:_scope = 0;
while ($true) { try { Get-Variable -Scope $_scope | Out-Null; $_scope += 1 } catch { return ($_scope - 1) } }