public static Azure DeployArmTemplate(string resourceGroup, string pathToTemplate, params string[] args)
 {
     return(new Azure
     {
         _info = new ProcessStartInfo("az", ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(new[] { "group", "deployment", "create", "--resource-group", resourceGroup, "--template-file", pathToTemplate }.Concat(args)))
         {
             UseShellExecute = false,
             CreateNoWindow = true,
             RedirectStandardError = true,
             RedirectStandardOutput = true
         }
     });
 }
 public static Azure CreateAppServicePlan(string name, string resourceGroup, params string[] args)
 {
     return(new Azure
     {
         _info = new ProcessStartInfo("az", ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(new[] { "appservice", "plan", "create", "--name", name, "--resource-group", resourceGroup }.Concat(args)))
         {
             UseShellExecute = false,
             CreateNoWindow = true,
             RedirectStandardError = true,
             RedirectStandardOutput = true
         }
     });
 }
 public static Azure CreateResourceGroup(string name, string location, params string[] args)
 {
     return(new Azure
     {
         _info = new ProcessStartInfo("az", ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(new[] { "group", "create", "--name", name, "--location", location }.Concat(args)))
         {
             UseShellExecute = false,
             CreateNoWindow = true,
             RedirectStandardError = true,
             RedirectStandardOutput = true
         }
     });
 }
 public static Azure Command(params string[] args)
 {
     return(new Azure()
     {
         _info = new ProcessStartInfo("az", ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args))
         {
             UseShellExecute = false,
             CreateNoWindow = true,
             RedirectStandardError = true,
             RedirectStandardOutput = true
         }
     });
 }
        public static Dotnet AddProjectsToSolution(string solutionFile, IReadOnlyList <string> projects)
        {
            var allArgs = new List <string>()
            {
                "sln",
                solutionFile,
                "add"
            };

            allArgs.AddRange(projects);
            string argString = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(allArgs);

            return(new Dotnet
            {
                _info = new ProcessStartInfo("dotnet", argString)
                {
                    UseShellExecute = false,
                    CreateNoWindow = true,
                    RedirectStandardError = true,
                    RedirectStandardOutput = true
                }
            });
        }
        public static Dotnet AddPackageReference(string projectFile, string packageName, string version = null)
        {
            string argString;

            if (version == null)
            {
                argString = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(new[] { "add", projectFile, "package", packageName, "--no-restore" });
            }
            else
            {
                argString = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(new[] { "add", projectFile, "package", packageName, "--version", version, "--no-restore" });
            }

            return(new Dotnet
            {
                _info = new ProcessStartInfo("dotnet", argString)
                {
                    UseShellExecute = false,
                    CreateNoWindow = true,
                    RedirectStandardError = true,
                    RedirectStandardOutput = true
                }
            });
        }