Function: vRA Machine Custom Properties Remove

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 Remove Machine Custom Properties

Public Function: MachineCustomPropertiesRemove

public MachineCustomPropertiesRemove(objVraMachine: VraMachine, arrKey: string[]): VraMachine {

    let objVraUpdateMachineSpecification: VraUpdateMachineSpecification = new VraUpdateMachineSpecification();

    arrKey.forEach((strKey: string): void => {
        objVraUpdateMachineSpecification.putCustomPropertiesItem(strKey, null);
    });

    let objVraHost: VraHost = objVraMachine.host;

    let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();

    // @ts-ignore
    let objVraMachineService: VraMachineService = objVraInfrastructureClient.createMachineService();

    objVraMachine = objVraMachineService.updateMachine(objVraMachine, objVraUpdateMachineSpecification);

    return objVraMachine;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like