Skip to content

Commit f3ff8c3

Browse files
committed
Port the Install-Release cmdlet
1 parent 356b15d commit f3ff8c3

File tree

2 files changed

+28
-64
lines changed

2 files changed

+28
-64
lines changed

src/Cmdlets/Install-Release.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ namespace Belin.SetupAnt.Cmdlets;
33
/// <summary>
44
/// Installs Apache Ant, after downloading it.
55
/// </summary>
6-
public class InstallReleaseCommand: Cmdlet {
6+
[Cmdlet(VerbsLifecycle.Install, "Release")]
7+
[OutputType(typeof(string))]
8+
public class InstallReleaseCommand: PSCmdlet {
79

10+
/// <summary>
11+
/// The instance of the release to be installed.
12+
/// </summary>
13+
[Parameter(Mandatory = true, ParameterSetName = "InputObject", ValueFromPipeline = true)]
14+
public required Release InputObject { get; set; }
15+
16+
/// <summary>
17+
/// Value indicating whether to fetch the Ant optional tasks.
18+
/// </summary>
19+
[Parameter]
20+
public SwitchParameter OptionalTasks { get; set; }
21+
22+
/// <summary>
23+
/// The version number of the release to be installed.
24+
/// </summary>
25+
[Parameter(Mandatory = true, ParameterSetName = "Version", Position = 0, ValueFromPipeline = true)]
26+
public required Version Version { get; set; }
27+
28+
/// <summary>
29+
/// Performs execution of this command.
30+
/// </summary>
31+
protected override void ProcessRecord() {
32+
var release = ParameterSetName == "InputObject" ? InputObject : new Release(Version);
33+
// TODO WriteObject(new Setup(release).Install(OptionalTasks));
34+
}
835
}

src/Cmdlets/Main.psm1

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)