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
Showing only changes of commit 6ae34b3c83 - Show all commits

chore(custom-host): Add way to manage PromptForChoice

Scott 2026-08-06 14:43:51 +10:00

View file

@ -121,6 +121,19 @@ public class CustomUiHost : PSHostUserInterface
public string Output => output.ToString();
private int? _nextChoiceOption;
/// <summary>
/// Sets the next choice option to be used on the next call to <see cref="PromptForChoice"/>.
///
/// You'll probably get the
/// </summary>
/// <param name="choiceOption"></param>
public void SetNextPromptChoice(int choiceOption)
{
_nextChoiceOption = choiceOption;
}
public override Dictionary<string, PSObject> Prompt(string caption, string message, System.Collections.ObjectModel.Collection<FieldDescription> descriptions)
{
throw new NotImplementedException("Prompt is not implemented. The script is asking for input, which is a problem since there's no console. Make sure the script can execute without prompting the user for input.");
@ -128,7 +141,14 @@ public class CustomUiHost : PSHostUserInterface
public override int PromptForChoice(string caption, string message, System.Collections.ObjectModel.Collection<ChoiceDescription> choices, int defaultChoice)
{
throw new NotImplementedException("PromptForChoice is not implemented. The script is asking for input, which is a problem since there's no console. Make sure the script can execute without prompting the user for input.");
if (_nextChoiceOption is null)
{
throw new NotImplementedException("PromptForChoice is not implemented. The script is asking for input, which is a problem since there's no console. Make sure the script can execute without prompting the user for input.");
}
var choiceReturn = _nextChoiceOption.Value;
_nextChoiceOption = null;
return choiceReturn;
}
public override PSCredential PromptForCredential(string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options)