If you've read the first article in this series , you already know that PSScriptBuilder resolves PowerShell class load order automatically. This article goes one level deeper: what exactly does PSScriptBuilder analyze, how does it build a dependency graph, and what happens when that graph contains a cycle?
What PSScriptBuilder Extracts
When PSScriptBuilder processes your source files, it runs AST analysis on every collected component and extracts the following dependency information:
Component Dependencies extracted
Class Base class, type references (properties, method parameters), static initializer references, called functions
Function Called functions, type references
Enum None — enums have no outgoing dependencies and always appear first
Built-in types ( string , int , bool , System.* , etc.) are automatically excluded — only types that are part of your project create graph edges.
The Dependency Graph
The extracted dependencies form a directed graph where each node is a component and each edge…