PowerShell Developer Reference
The SetupPS runtime provides the PowerShell scripting environment used by AdvantageBuilder macros and templates. It exposes functions for database access, UI interaction, HTML forms, macro execution, JSON handling, ObjectStore integration, and .NET/COM interop.
Overview
AdvantageBuilder’s PowerShell runtime is a custom environment built on top of Windows PowerShell. It provides a unified API surface shared with JScript.NET and ClearScript V8, allowing macros and templates to run consistently across engines.
User Interaction
alert($message)confirm($message)prompt2($title, $message, $defaultValue)prompt($message, $defaultValue)
Database Access
ExecuteNonQuery($commandText, $connectionType, $connectionString)ExecuteDataset($commandText, $connectionType, $connectionString)ExecuteDatasetXML($commandText, $connectionType, $connectionString)ExecuteBatchTran($commands, $connectionType, $connectionString)
HTML Forms (IE Engine)
showHTMLForm– shows an HTML form and returns its documentloadHTMLDocument– loads an HTML document
HTML Forms (Edge Engine)
showHTMLFormEdge– returns Document and JSON State
GUI / File System
getGUIFilePath($fileName, $path)browseFolders($initialPath)
Dataset / Data
createDataSet()
JSON
convertToJSON($obj)
Macro Execution
callMacro($displayResult, $macroName, $macroPath, $args)callMacroAsync($displayResult, $macroName, $macroPath, $args)createMacro($macroName, $macroPath, $macroContent)setMacroToRunAsync($macroName, $macroPath, $runAsyncAsDefault)
GUI / Status
updateProgress($percentage)setStatusText($text)
Variables
getVariable($key)
Logger / Connection
getLogger()getCurrentConnection()
ObjectStore
addToObjectStore($key, $obj)getFromObjectStore($key)
.NET / COM Interop
createActiveXObject($progId)createInstance($fullyQualifiedName, $parameters)loadAssembly($name)loadAssemblyFrom($assemblyFile)
Macro Scheduler
addMacroSchedule($name, $path, $recurrenceType, $referenceFrequency, $recurrenceDetail, $timeOfDay)removeMacroSchedule($scheduleId)