Run scripts as admin if directed via script contents
This commit is contained in:
parent
f19ef09ff8
commit
a47b77cc5c
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue