To use this function add it to the class library file named PluginVCVirtualMachineService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: PluginVCVirtualMachineService.ts
Function:GetAllVcVirtualDevicesByType
private GetAllVcVirtualDevicesByType<T>(objVcVirtualMachine: VcVirtualMachine): T[] {
let arrVcVirtualDevice: VcVirtualDevice[] = this.GetAllVcVirtualDevices(objVcVirtualMachine);
//@ts-ignore
let arrVcVirtualDeviceType: T[] = arrVcVirtualDevice.filter((objVcVirtualDevice: VcVirtualDevice): objVcVirtualDevice is T => {
//@ts-ignore
return objVcVirtualDevice instanceof T;
});
return arrVcVirtualDeviceType;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
