public DownloadAppInstaller(IConsoleLogger consoleLogger,
                             IPowerShell powerShell,
                             IDownloaderFactory downloaderFactory)
 {
     this.consoleLogger     = consoleLogger;
     this.powerShell        = powerShell;
     this.downloaderFactory = downloaderFactory;
 }
 public GitHubAssetDownloader(IJsonSerializer jsonSerializer,
                              IPowerShell powerShell,
                              IResourceDownloader resourceDownloader)
 {
     this.jsonSerializer     = jsonSerializer;
     this.powerShell         = powerShell;
     this.resourceDownloader = resourceDownloader;
 }
示例#3
0
 public AgentPool(PSObject obj, IPowerShell powerShell) :
     base(obj, obj.GetValue("name"), "Agent", powerShell, null)
 {
     if (this.IsHosted)
     {
         this.DisplayMode = "d-r-s-";
     }
     ;
 }
示例#4
0
 public GitRepository(PSObject obj, string projectName, IPowerShell powerShell) :
     base(obj, obj.GetValue("Name"), "GitRef", powerShell, projectName)
 {
     if (obj.HasValue("project"))
     {
         this.Project     = new Project(obj.GetValue <PSObject>("project"), powerShell);
         this.ProjectName = this.Project.Name;
     }
 }
示例#5
0
        /// <summary>
        /// Used for testing
        /// </summary>
        public Package(PSObject obj, string feedId, IPowerShell powerShell) :
            base(obj, obj.GetValue("name"), "Version", powerShell, null)
        {
            this.FeedId = feedId;

            if (obj.HasValue("_links"))
            {
                this.Links = new Link(obj);
            }
        }
示例#6
0
文件: Common.cs 项目: staker4/vsteam
        public static string GetDefaultProject(IPowerShell powerShell)
        {
            powerShell.Commands.Clear();

            var results = powerShell.AddScript("$Global:PSDefaultParameterValues[\"*-vsteam*:projectName\"]")
                          .Invoke <string>();

            PowerShellWrapper.LogPowerShellError(powerShell, results);

            return(results[0]);
        }
示例#7
0
        public Environment(PSObject obj, long releaseId, string projectName, IPowerShell powerShell) :
            base(obj, obj.GetValue("name"), "Attempt", powerShell, projectName)
        {
            this.ReleaseId = releaseId;

            this.Attempts = new List <Attempt>();
            foreach (var item in obj.GetValue <object[]>("deploySteps"))
            {
                this.Attempts.Add(new Attempt((PSObject)item, this.ProjectName));
            }
        }
示例#8
0
        public Release(PSObject obj, IPowerShell powerShell, string projectName) :
            base(obj, obj.GetValue("name"), "Release", powerShell, projectName)
        {
            this.CreatedBy  = new User(obj.GetValue <PSObject>("createdBy"));
            this.ModifiedBy = new User(obj.GetValue <PSObject>("modifiedBy"));

            this.Project = new Project(obj.GetValue <PSObject>("projectReference"), powerShell);

            this.PopulateEnvironments(obj);

            this.ReleaseDefinition = new ReleaseDefinition(obj.GetValue <PSObject>("releaseDefinition"), projectName);
        }
示例#9
0
        public BuildDefinitionProcessPhase(PSObject obj, string projectName, IPowerShell powerShell) :
            base(obj, obj.GetValue("name"), "BuildDefinitionProcessPhase", powerShell, projectName)
        {
            this.Steps = new List <BuildDefinitionProcessPhaseStep>();

            if (obj.HasValue("steps"))
            {
                var i = 1;
                foreach (var item in obj.GetValue <object[]>("steps"))
                {
                    this.Steps.Add(new BuildDefinitionProcessPhaseStep((PSObject)item, i++, projectName));
                }

                this.StepCount = this.Steps.Count;
            }
        }
示例#10
0
        public BuildDefinitionProcess(PSObject obj, string projectName, IPowerShell powerShell) :
            base(obj, "Process", string.Empty, powerShell, projectName)
        {
            if (this.Type == 1)
            {
                this.TypeName = "BuildDefinitionPhasedProcess";

                this.Phases = new List <BuildDefinitionProcessPhase>();
                foreach (var item in obj.GetValue <object[]>("phases"))
                {
                    this.Phases.Add(new BuildDefinitionProcessPhase((PSObject)item, projectName, powerShell));
                }
            }
            else
            {
                this.DisplayMode = "------";
                this.TypeName    = "BuildDefinitionYamlProcess";
            }
        }
示例#11
0
        public Build(PSObject obj, string projectName, IPowerShell powerShell) :
            base(obj, obj.GetValue("buildNumber"), obj.GetValue("Id"), projectName)

        {
            this.TriggerInfo = obj.GetValue <PSObject>("TriggerInfo");

            this.RequestedBy   = new User(obj.GetValue <PSObject>("requestedBy"));
            this.RequestedFor  = new User(obj.GetValue <PSObject>("requestedFor"));
            this.LastChangedBy = new User(obj.GetValue <PSObject>("lastChangedBy"));

            this.Project = new Project(obj.GetValue <PSObject>("project"), powerShell);

            // When you try to use Get-VSTeamBuild on the build that is running sometimes
            // the queue is not present yet
            if (obj.HasValue("queue"))
            {
                this.Queue = new Queue(obj.GetValue <PSObject>("queue"), projectName, powerShell);
            }

            this.BuildDefinition = new BuildDefinition(obj.GetValue <PSObject>("definition"), projectName, powerShell);
        }
示例#12
0
        public BuildDefinition(PSObject obj, string projectName, IPowerShell powerShell) :
            base(obj, obj.GetValue("name"), "BuildDefinition", powerShell, projectName)
        {
            this.Tags    = obj.GetStringArray("tags");
            this.Demands = obj.GetStringArray("demands");

            if (obj.HasValue("authoredBy"))
            {
                this.AuthoredBy = new User(obj.GetValue <PSObject>("authoredBy"));
            }

            // Depending on the build definition you might have a build or
            // process element.
            if (obj.HasValue("build"))
            {
                var i = 1;
                this.Steps = new List <BuildDefinitionProcessPhaseStep>();
                foreach (var item in obj.GetValue <object[]>("build"))
                {
                    this.Steps.Add(new BuildDefinitionProcessPhaseStep((PSObject)item, i++, projectName));
                }
            }

            if (obj.HasValue("process"))
            {
                this.Process = new BuildDefinitionProcess(obj.GetValue <PSObject>("process"), projectName, powerShell);
            }

            if (obj.HasValue("queue"))
            {
                this.Queue = new Queue(obj.GetValue <PSObject>("queue"), this.ProjectName, powerShell);
            }

            if (this.RepositoryType == "TfsGit")
            {
                this.GitRepository = new GitRepository(obj.GetValue <PSObject>("repository"), this.ProjectName, powerShell);
            }
        }
示例#13
0
 public Permissions(string name, IPowerShell powerShell) :
     base(name, null, powerShell)
 {
 }
示例#14
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 internal WorkItemTypeCompleter(IPowerShell powerShell) : base("Get-VSTeamWorkItemType", "Name", false, powerShell)
 {
 }
 public WingetCliInstaller(IDownloadAppInstaller downloadAppInstaller, IPowerShell powerShell)
 {
     this.downloadAppInstaller = downloadAppInstaller;
     this.powerShell           = powerShell;
 }
示例#16
0
 public Releases(IPowerShell powerShell, string projectName) :
     base(null, "Releases", "Release", powerShell, projectName)
 {
 }
示例#17
0
文件: Queue.cs 项目: staker4/vsteam
 public Queue(PSObject obj, string projectName, IPowerShell powerShell) :
     base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName)
 {
     this.Pool = new AgentPool(obj.GetValue <PSObject>("pool"), powerShell);
 }
 public PowerShellConfiguration(IPowerShell powerShell, IWindowsPowerShell windowsPowerShell, IConsoleLogger consoleLogger)
 {
     this.powerShell        = powerShell;
     this.windowsPowerShell = windowsPowerShell;
     this.consoleLogger     = consoleLogger;
 }
示例#19
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 public ProcessTemplateCompleter(IPowerShell powerShell) : base(powerShell)
 {
 }
示例#20
0
 public Agent(PSObject obj, long poolId, IPowerShell powerShell) :
     base(obj, obj.GetValue("name"), "JobRequest", powerShell, null)
 {
     this.PoolId = poolId;
 }
示例#21
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 public InvokeCompleter(IPowerShell powerShell) : base(powerShell)
 {
 }
示例#22
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 protected BaseProjectCompleter(string command, string property, bool descending, IPowerShell powerShell) : base(powerShell)
 {
     this._command    = command;
     this._property   = property;
     this._descending = descending;
 }
示例#23
0
 /// <summary>
 /// Used for testing
 /// </summary>
 public Project(PSObject obj, IPowerShell powerShell) :
     base(obj, obj.GetValue("name"), null, powerShell, obj.GetValue("name"))
 {
 }
示例#24
0
 /// <summary>
 /// This is called by unit testing framework and other constructors
 /// </summary>
 /// <param name="name"></param>
 /// <param name="powerShell"></param>
 public Account(string name, IPowerShell powerShell) :
     base(name, "Project", powerShell)
 {
     // Invalidate any cache of projects
     ProjectCache.Invalidate();
 }
示例#25
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 internal BuildDefinitionCompleter(IPowerShell powerShell) : base("Get-VSTeamBuildDefinition", "Name", false, powerShell)
 {
 }
示例#26
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 protected BaseCompleter(IPowerShell powerShell)
 {
     this._powerShell = powerShell;
 }
示例#27
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 internal QueryCompleter(IPowerShell powerShell) : base("Get-VSTeamQuery", "Name", false, powerShell)
 {
 }
示例#28
0
 public TimeZoneCompleter(IPowerShell powerShell) : base(powerShell)
 {
 }
示例#29
0
 /// <summary>
 /// This constructor is used during unit testings
 /// </summary>
 /// <param name="powerShell">fake instance of IPowerShell used for testing</param>
 internal BuildCompleter(IPowerShell powerShell) : base("Get-VSTeamBuild", "BuildNumber", true, powerShell)
 {
 }
 public AppInstaller(IPowerShell powerShell, IConsoleLogger consoleLogger, IDesktopRepository desktopRepository)
 {
     this.powerShell        = powerShell;
     this.consoleLogger     = consoleLogger;
     this.desktopRepository = desktopRepository;
 }