public IDeployAgent GetDeployAgent(Mapping mapping) { if (string.IsNullOrEmpty(mapping.Script)) { return(null); } IDeployAgent agent; if (mapping.RunnerType == RunnerType.BatchFile) { agent = new BatchFileDeployAgent(); } else { agent = new LocalPowerShellDeployAgent(); } return(agent); }
public IDeployAgent GetDeployAgent(Mapping mapping) { IDeployAgent agent; if (mapping.RunnerType == RunnerType.BatchFile) { agent = new BatchFileDeployAgent(); } else { var powerShellDeployAgent = new LocalPowerShellDeployAgent(); if (Settings.Default.IgnoreSystemPowerShellExecutionPolicy) { powerShellDeployAgent.ExecutionPolicyBehaviour = PowerShellExecutionPolicyBehaviour.Unrestricted; } agent = powerShellDeployAgent; } return(agent); }
public IDeployAgent GetDeployAgent(Mapping mapping) { if (string.IsNullOrEmpty(mapping.Script)) { return(null); } IDeployAgent agent; if (mapping.RunnerType == RunnerType.BatchFile) { agent = new BatchFileDeployAgent(); } else { var clrVersion = ClrVersion.Version2; if (mapping.RunnerTypeSpecified && mapping.RunnerType == RunnerType.PowerShellV3) { clrVersion = ClrVersion.Version4; } agent = _componentContext.Resolve <OutOfProcessPowerShellDeployAgent>(new TypedParameter(typeof(ClrVersion), clrVersion)); } return(agent); }