{"id":4086,"date":"2019-05-03T07:07:15","date_gmt":"2019-05-03T07:07:15","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=4086"},"modified":"2019-05-03T07:07:15","modified_gmt":"2019-05-03T07:07:15","slug":"how-to-elevate-existing-powershell-windows-to-local-admin-uac","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/code\/how-to-elevate-existing-powershell-windows-to-local-admin-uac","title":{"rendered":"How to elevate existing powershell Windows to Local Admin ( UAC )"},"content":{"rendered":"<p>Add the below to the top of your script<\/p><p>[pastacode lang=&#8221;markdown&#8221; manual=&#8221;if%20(!(%5BSecurity.Principal.WindowsPrincipal%5D%5BSecurity.Principal.WindowsIdentity%5D%3A%3AGetCurrent()).IsInRole(%5BSecurity.Principal.WindowsBuiltInRole%5D%20%22Administrator%22))%20%7B%20Start-Process%20powershell.exe%20%22-NoProfile%20-ExecutionPolicy%20Bypass%20-File%20%60%22%24PSCommandPath%60%22%22%20-Verb%20RunAs%3B%20exit%20%7D%0A%0A%23%20Your%20script%20here&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>","protected":false},"excerpt":{"rendered":"<p>Add the below to the top of your script[pastacode lang=&#8221;markdown&#8221; manual=&#8221;if%20(!(%5BSecurity.Principal.WindowsPrincipal%5D%5BSecurity.Principal.WindowsIdentity%5D%3A%3AGetCurrent()).IsInRole(%5BSecurity.Principal.WindowsBuiltInRole%5D%20%22Administrator%22))%20%7B%20Start-Process%20powershell.exe%20%22-NoProfile%20-ExecutionPolicy%20Bypass%20-File%20%60%22%24PSCommandPath%60%22%22%20-Verb%20RunAs%3B%20exit%20%7D%0A%0A%23%20Your%20script%20here&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[],"class_list":["post-4086","post","type-post","status-publish","format-standard","hentry","category-code"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=4086"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4086\/revisions"}],"predecessor-version":[{"id":4087,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4086\/revisions\/4087"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=4086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=4086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=4086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}