Run scripts as admin if directed via script contents
parent
f19ef09ff8
commit
a47b77cc5c
|
@ -123,6 +123,9 @@ namespace LANCommander.SDK.PowerShell
|
||||||
|
|
||||||
var wow64Value = IntPtr.Zero;
|
var wow64Value = IntPtr.Zero;
|
||||||
|
|
||||||
|
if (Contents.StartsWith("# Requires Admin"))
|
||||||
|
RunAsAdmin();
|
||||||
|
|
||||||
foreach (var module in Modules)
|
foreach (var module in Modules)
|
||||||
{
|
{
|
||||||
scriptBuilder.AppendLine($"Import-Module \"{module}\"");
|
scriptBuilder.AppendLine($"Import-Module \"{module}\"");
|
||||||
|
|
Loading…
Reference in New Issue