Skip to content

Commit

Permalink
added requirement to PSEnsure to use AHEXECMODE
Browse files Browse the repository at this point in the history
  • Loading branch information
apxltd committed Feb 18, 2021
1 parent 95c90db commit ba4e5db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Scripting/InedoExtension/PowerShell/PSUtil.cs
Expand Up @@ -88,6 +88,15 @@ void setOutputVariable(string oe)
variables = arguments.ToDictionary(a => a.Key, a => a.Value);
}

if (executionMode == PsExecutionMode.Configure && string.IsNullOrEmpty(scriptInfo?.ExecutionModeVariableName))
{
logger.LogError(
".AHEXECMODE additional help was not detected. When using PSEnsure to remediate drift, you must specify the name of " +
"a variable that will capture \"Collect\" or \"Configure\" in the .AHEXECMODE help."
);
return null;
}

var jobRunner = context.Agent.GetService<IRemoteJobExecuter>();

var job = new ExecutePowerShellJob
Expand Down

0 comments on commit ba4e5db

Please sign in to comment.