/// <inheritdoc/> public async Task <GrpGetVmDrivesReply> GetVmDrivesAsync(GrpcGetVmDrivesRequest request, CallContext context = default) { await SyncContext.Clear; try { return(new GrpGetVmDrivesReply(hyperv.GetVmDrives(request.MachineName))); } catch (Exception e) { return(new GrpGetVmDrivesReply(e)); } }
/// <summary> /// Returns host file system paths to any virtual drives attached to /// the named virtual machine. /// </summary> /// <param name="machineName">The machine name.</param> /// <returns>The list of fully qualified virtual drive file paths.</returns> public List <string> GetVmDrives(string machineName) { if (isAdmin) { return(hypervClient.GetVmDrives(machineName: machineName)); } else { var request = new GrpcGetVmDrivesRequest(machineName: machineName); var reply = desktopService.GetVmDrivesAsync(request).Result; reply.Error.EnsureSuccess(); return(reply.DrivePaths); } }