feat(git-provider): Initial Get-GitRepo implementation

This commit is contained in:
Scott 2026-08-23 09:25:45 +10:00
commit af5c9e43b6
2 changed files with 30 additions and 0 deletions

View file

@ -52,4 +52,15 @@ public class GitManager
throw new Exception($"Git repo already registered with the name {registrationName}"); throw new Exception($"Git repo already registered with the name {registrationName}");
} }
public List<GitReg> ListRepos()
{
return _registrations.Select(x => new GitReg() { Name = x.Value.Name, Location = x.Value.Location }).ToList();
}
}
public class GitReg
{
public required string Name { get; set; }
public required string Location { get; set; }
} }

View file

@ -0,0 +1,19 @@
using System.Management.Automation;
using ModuleCore.Git;
namespace PowershellModule.Git.Commands;
[Cmdlet(VerbsCommon.Get, Noun)]
public class ListGitRepoCommand : PSCmdlet
{
private const string Noun = "GitRepo";
protected override void BeginProcessing()
{
var repos = GitManager.Instance.ListRepos();
WriteObject(repos);
base.BeginProcessing();
}
}