Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Created April 28, 2017 17:20
Show Gist options
  • Save hishaamn/6552391a75f7b77d8ec62c9760278d96 to your computer and use it in GitHub Desktop.
Save hishaamn/6552391a75f7b77d8ec62c9760278d96 to your computer and use it in GitHub Desktop.
[HttpGet]
public ActionResult SiteCreator()
{
var shellSite = SiteContext.GetSite("shell");
using (new SiteContextSwitcher(shellSite))
{
var urlString = new UrlString(UIUtil.GetUri("control:PowerShellRunner"));
urlString.Append("scriptId", "My SPE Script Id");
urlString.Append("scriptDb", "master");
return new JsonResult { Data = urlString.ToString(), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment