Skip to content

Assembly

An Assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. In a ScriptoForm, assemblies are provided by Microsoft with the .NET framework within PowerShell and are used to implement Windows forms and child controls or components. They can be referenced by using the Add-Type cmdlet, which lets you define a Microsoft .NET class in your PowerShell session available in the referenced assembly. You can then instantiate objects, by using the New-Object cmdlet, and use the objects just as you would use any .NET object.
PowerShell
Add-Type -AssemblyName System.Windows.Forms
# Other lesser used assemblies:
Add-Type -AssemblyName System.Windows.Forms.DataVisualization
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Data
Add-Type -AssemblyName System.Xml

An Assembly must be loaded prior to instantiating any form or control defined in it.