FDD-2026-001

vRO PowerShell Host vs. JavaScript APIs

When to use a PowerShell host, when to stay in JavaScript, and why REST APIs are the foundation of everything Aria Orchestrator does.

Author
CFTV Infrastructure Team
Audience
vRO Developers
Created
May 2026
Last Updated
May 2026
Version
1.0
Tags
vRO PowerShell REST Architecture
Contents
  1. The Rhino Sandbox Problem
  2. What a PowerShell Host Actually Is
  3. Execution Path Comparison
  4. When to Use PowerShell
  5. When to Stay in JavaScript
  6. The Data Manipulation Question
  7. Why APIs Are vRO's Foundation
  8. Key Decisions
01

The Rhino Sandbox Problem

vRO's scripting engine is Mozilla Rhino 1.7R4 — a Java-based JavaScript runtime frozen at roughly ECMAScript 5.1. It runs entirely inside the JVM on the vRO appliance and has no OS-level access of any kind: no shell execution, no process spawning, no Win32 API surface, no PowerShell runtime.

This is not a limitation that can be worked around from within a scriptable task or action. Rhino can parse JSON, call REST endpoints via the REST plugin, and manipulate vCenter objects through the vSphere API wrapper — but it cannot natively run a .ps1 script or invoke a PowerShell cmdlet.

What this meansAnything requiring PowerShell cmdlets, Windows modules, or OS-level access must be delegated to an external host. Everything else should stay inside vRO's JS execution model.
02

What a PowerShell Host Actually Is

A PowerShell host is a registered Windows machine (or the vRO appliance via SSH) running the vmware-vro-powershell-host service. vRO connects to it over a TCP socket and ships PowerShell commands for execution there, returning results as structured objects.

The "inline PowerShell" exposed by the PowerShell scripting plugin is transparently proxied to this host — it is not local execution. If no host is registered, all such calls fail.

JavaScript// This looks inline but executes on the remote PS host
var host = PowerShellHostManager.getHost("MyPSHost");
var result = host.invokeScript("Get-Date");
System.log(result.invocationResult);
Dependency RiskEvery PS host call introduces an external dependency. If the host is down, patching, or unreachable, workflows that use it will fail — even for operations that have nothing to do with Windows.
03

Execution Path Comparison

The performance difference between a native REST call and a PowerShell-proxied one is significant — not just in speed, but in failure surface.

JavaScript REST Call (Native)

vRO Native REST Execution Path
vRO Rhino (JVM) RESTHostManager JVM HTTP Client API Endpoint

PowerShell Host Call

PowerShell Host Execution Path
vRO Rhino (JVM) TCP Socket PS Host Service PS Process Spawn .NET HTTP Client API Endpoint
FactorJavaScript (REST Plugin)PowerShell Host
Execution locationvRO appliance JVMRemote Windows host
Process spawn overheadNone500ms–2s per invocation
Network dependencyTo target API onlyPS host + target API
Failure modesRhino errors, REST failuresHost down, WinRM, auth, PS errors
Debug surfacevRO logs onlyvRO logs + PS host logs
Infrastructure to maintainNoneWindows host + service
04

When to Use PowerShell

Use a PowerShell host when the data source or operation is fundamentally cmdlet-native and has no REST equivalent — or when the available REST API is significantly less capable than the corresponding PowerShell module.

Use CaseWhy PS Wins
Active Directory operationsNo AD module in Rhino; Get-ADGroupMember with full flags outpaces Microsoft Graph for many operations
Exchange / Exchange Online cmdletsExchange is PS-native; REST coverage is incomplete
Windows WMI / CIM queriesNo WMI bindings exist in vRO
Existing .ps1 scriptsReuse without rewrite; stable tested code
Operations requiring Import-ModuleModule loading is impossible in Rhino
Windows filesystem operationsNo OS access from JS

Example — AD Group Membership Check

JavaScriptvar host = PowerShellHostManager.getHost("AD-PS-Host");
var script = "Get-ADGroupMember -Identity 'Server-Admins' | Select-Object -ExpandProperty SamAccountName";
var result = host.invokeScript(script);
System.log("[ADCheck] Members: " + result.invocationResult);
Good PatternWhen PS owns the data source, let it own the shaping too. Filter and reduce inside PS before returning results to vRO — don't hand back 6,000 raw AD objects when PS can return 12 filtered ones.
05

When to Stay in JavaScript

If the operation has a REST API or a native vRO plugin, keep it in JavaScript. The REST plugin is purpose-built for this work, lives inside the JVM, and eliminates the PS host dependency entirely.

Data SourceOwned ByDo Work In
Azure ARM / Resource ManagerREST APIJavaScript
Aria AutomationREST APIJavaScript
Infoblox WAPIREST APIJavaScript
ServiceNow / ITSM PlatformREST APIJavaScript
vCenter / ESXiVcPlugin (vSphere API)JavaScript
vRO workflow executionvRO internal APIJavaScript
Config element lookupsvRO internalJavaScript
JSON parsing / data manipulationRhino engineJavaScript

Example — What Not to Do

JavaScript — Anti-Pattern// DON'T: spin up a PS host just to make an API call
// vRO → PS host → REST call → results → back to vRO
// Every hop is waste — and a potential failure point

// DO: use the REST plugin directly — faster, no host dependency
var host = RESTHostManager.getHost("AzureREST");
var req = host.createRequest("GET", "/subscriptions/" + subId + "/resourceGroups", "");
req.setHeader("Authorization", "Bearer " + token);
var resp = req.execute();
var parsed = JSON.parse(resp.contentAsString);
06

The Data Manipulation Question

A common question: if a PS host makes an API call that returns 6,000 objects, should PS manipulate the data before returning it to vRO? The answer depends entirely on who owns the data source.

Rule: Who Owns the Data Source?

If the data comes from a REST API that vRO can call directly, the PS host should never be in the picture at all. vRO's REST plugin fetches the data, JSON.parse() deserializes it, and a standard for loop filters it — all inside the JVM, with no external host dependency.

JavaScript — Correct Pattern// REST call → parse → filter — all in JS, no PS host needed
var req = restHost.createRequest("GET", "/api/v2/vms", "");
var resp = req.execute();
var allVms = JSON.parse(resp.contentAsString).value;

var filtered = [];
for (var i = 0; i < allVms.length; i++) {
    if (allVms[i].powerState === "poweredOn") {
        filtered.push(allVms[i].name);
    }
}

If the data comes from a cmdlet-native source (Active Directory, Exchange, WMI), PS should own the entire operation — including filtering. Return only what vRO needs. Don't hand back raw collections of thousands of objects when a Where-Object or Select-Object can trim it first.

The Anti-PatternUsing PS as a data processing layer for data you could have fetched directly in vRO is the worst of both worlds: PS host dependency + network round-trip overhead + slower execution + harder to debug. If there are no cmdlets or Windows-native modules in your PS script — just REST calls and data wrangling — move it to JavaScript.

Quick Decision Test

QuestionIf YesIf No
Does the script use Import-Module?PS host — module loading is impossible in RhinoLikely belongs in JS
Are there AD / Exchange / WMI cmdlets?PS host — no equivalent in RhinoEvaluate REST alternative
Is it just REST calls + JSON parsing?Move to JS — REST plugin handles this nativelyMay still need PS for other reasons
Does the target have a documented REST API?Use it from JSPS host may be the only option
07

Why APIs Are vRO's Foundation

vRO has no native UI, no direct database access, and no agent on managed systems. It is a pure orchestration engine. This means everything vRO does to the outside world, it does through an API.

vRO Integration Surface — Everything Is an API
vRO Orchestrator
vSphere API · Azure ARM REST · Infoblox WAPI · ITSM REST · Aria REST
vCenter / ESXi · Azure Resources · DNS / IPAM · Tickets / CMDB

Even VcPlugin — which feels like native vCenter access — is a strongly-typed SDK wrapper over the vSphere SOAP/REST API. vRO did not receive special OS-level access to ESXi. It received a well-structured client over the same API that any other integration tool uses.

Why This Architecture Scales

Because everything is API-driven, vRO's orchestration capability scales directly with how many APIs have been integrated. A vRO instance with REST hosts for Azure, Infoblox, Aria, and an ITSM platform can orchestrate an entire provisioning lifecycle — compute, DNS, IPAM, and ticketing — in a single workflow, with no agents, no PS hosts, and no remote sessions.

REST Hosts and Config Elements Are First-Class CitizensThey are not convenience features — they are how vRO reaches everything it manages. A well-structured set of REST hosts, config elements, and reusable actions is what separates a maintainable vRO environment from a pile of one-off workflows.

The PS Host Exception, Restated

PS hosts exist because some platforms lack REST APIs — or their REST APIs are incomplete relative to their PowerShell modules. Active Directory is the canonical example. Microsoft's Graph API covers some AD operations, but cmdlet coverage with full pipeline support still outpaces what Graph exposes for many common infrastructure tasks.

When a vendor provides a strong REST API, use it from JavaScript. When they provide a strong PS module and a limited REST API, use the PS host — but only for that specific gap. It should not become the default integration pattern.

08

Key Decisions

Accepted REST calls always go through the vRO REST plugin, never through a PS host
Using a PS host to proxy REST calls adds an external dependency, process spawn overhead, and a second failure surface for an operation vRO can perform natively. The REST plugin executes inside the JVM with no additional infrastructure.
Accepted Data manipulation and JSON parsing belong in JavaScript, not PowerShell
Rhino's JSON.parse() and standard array iteration are sufficient for all data shaping tasks on REST-sourced data. There is no reason to delegate this to a PS host. If PS owns the data source (e.g., AD), it should pre-filter before returning to vRO.
Accepted PS hosts are justified only when the data source requires cmdlets or Windows modules
Active Directory, Exchange, WMI/CIM, and operations requiring Import-Module have no Rhino equivalent. These are the legitimate PS host use cases. If a PS script contains no cmdlets — only REST calls and JSON wrangling — it should be rewritten as a vRO JavaScript action.
Rejected Using PowerShell as a general-purpose scripting layer in vRO
Treating the PS host as the default integration mechanism — rather than a targeted tool for Windows-native operations — creates unnecessary host dependencies, degrades workflow performance, and complicates debugging by spreading execution across two environments.