Function: vRA Machine Get by Name

by Simon Sparks · 3 April 2026

To use this function add it to the class library file named PluginVRAService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: PluginVRAService.ts

Description: Orchestrator Function to Get a Machine by Name

Public Function: MachineGetByName

publicMachineGetByName(objVraHost:VraHost,strVraMachineName:string):VraMachine{

letstrXPathQuery:string=`name=${strVraMachineName} or hostname=${strVraMachineName}`;

letarrVraMachine:VraMachine[]=this.FindAllForType<VraMachine>("Machine",strXPathQuery);

letobjVraMachine:VraMachine=arrVraMachine.find((objVraMachine:VraMachine):boolean=>{
returnobjVraMachine.name===strVraMachineName||objVraMachine.hostname===strVraMachineName;
});

returnobjVraMachine;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like