feat: Add GitRepoRegistration cmdlets #5

Merged
pascal_nulah merged 69 commits from feature/git-provider into dev 2026-09-06 09:33:36 +10:00
2 changed files with 30 additions and 0 deletions
Showing only changes of commit af5c9e43b6 - Show all commits

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

Scott 2026-08-23 09:25:45 +10:00

View file

@ -52,4 +52,15 @@ public class GitManager
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();
}
}