public async System.Threading.Tasks.Task <FileResult> DownloadDeviceManagementScript(String Id) { GraphIntune graphIntune = new GraphIntune(null); DeviceManagementScript script = await graphIntune.GetDeviceManagementScriptAsync(Id); return(File(script.ScriptContent, "text/plain", script.FileName)); }
public async Task <ActionResult> DownloadDeviceManagementScript(String Id) { try { GraphIntune graphIntune = new GraphIntune(null); DeviceManagementScript script = await graphIntune.GetDeviceManagementScriptAsync(Id); return(File(script.ScriptContent, "text/plain", script.FileName)); } catch (ServiceException e) { Flash(e.Error.Message); return(RedirectToAction("Index", "Home")); } }
public async Task <ActionResult> PowerShellScriptContent(string Id) { try { GraphIntune graphIntune = new GraphIntune(null); var scripts = await graphIntune.GetDeviceManagementScriptAsync(Id); string powerShellCode = Encoding.UTF8.GetString(scripts.ScriptContent); return(PartialView("_PowerShellScriptContent", powerShellCode)); } catch (ServiceException e) { Flash(e.Error.Message); return(RedirectToAction("Index", "Home")); } }
public async System.Threading.Tasks.Task <PartialViewResult> PowerShellScriptContent(string Id) { try { GraphIntune graphIntune = new GraphIntune(null); var scripts = await graphIntune.GetDeviceManagementScriptAsync(Id); string powerShellCode = Encoding.UTF8.GetString(scripts.ScriptContent); return(PartialView("_PowerShellScriptContent", powerShellCode)); } catch (Exception e) { Flash("Error getting DeviceManagementScripts" + e.Message.ToString()); return(PartialView()); } }