ps/Modules/Cole.PowerShell.Developer/Public/Get-FunctionWriteProgressHelperCalls.ps1

10 lines
414 B
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
function Get-FunctionWriteProgressHelperCalls {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$FunctionName
)
$commandDefinition = (Show-CommandDefinition $FunctionName)
return ([System.Management.Automation.PsParser]::Tokenize($commandDefinition, [ref]$null) | where { $_.Type -eq 'Command' -and $_.Content -eq 'Write-ProgressHelper' }).Count
}