You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c9e460d
Browse filesBrowse the repository at this point in the historyBrowse files
Resolve commands the analyzed script defines against the script
Command lookups run against a pristine runspace, so a function the script defines itself was answered by whatever module happened to be installed on the analyzing machine. A script defining 'function Get-ChildItem { param($PATH) }' had its call to that function validated against the real cmdlet, and UseCorrectCasing offered to rewrite -PATH to -Path to match a command PowerShell would never bind. Results therefore depended on the host rather than the script.
Collect the FunctionDefinitionAst names once per analysis and answer lookups for those names locally. Output changes only where a script shadows an installed command; a script-defined name that is not installed already resolved to null, just 59ms slower per name, which is where most of the analysis time went.
Also removes a duplicated nested CommandLookupKey and adds lookup counters used to locate the bottleneck.
// Algorithm from https://stackoverflow.com/questions/1646807/quick-and-simple-hash-code-combinations
0 commit comments