Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override void TurnOn()
}

var executed = _isScript
? PowershellManager.ExecuteScriptHeadless(Command)
? PowershellManager.ExecuteScriptHeadless(Command, string.Empty)
: PowershellManager.ExecuteCommandHeadless(Command);

if (!executed) Log.Error("[POWERSHELL] [{name}] Executing {descriptor} failed", Name, _descriptor, Name);
Expand All @@ -57,12 +57,9 @@ public override void TurnOnWithAction(string action)
{
State = "ON";

// prepare command
var command = string.IsNullOrWhiteSpace(Command) ? action : $"{Command} {action}";

var executed = _isScript
? PowershellManager.ExecuteScriptHeadless(command)
: PowershellManager.ExecuteCommandHeadless(command);
? PowershellManager.ExecuteScriptHeadless(Command, action)
: PowershellManager.ExecuteCommandHeadless(Command);

if (!executed) Log.Error("[POWERSHELL] [{name}] Launching PS {descriptor} with action '{action}' failed", Name, _descriptor, action);

Expand Down
Loading