-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for building bicepparam files (#62)
* Add support for building bicepparam files * validate that provided input is not empty, improved error message when building param file, removal of unnecessary return statement * changed from pattern matching to is not null --------- Co-authored-by: Emanuel Palm <emanuel+github@pipe.how>
- Loading branch information
1 parent
cac05ae
commit fc1c4d4
Showing
5 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Management.Automation; | ||
|
||
namespace BicepNet.PS.Commands; | ||
|
||
[Cmdlet(VerbsLifecycle.Build, "BicepNetParamFile")] | ||
public class BuildBicepNetParamFileCommand : BicepNetBaseCommand | ||
{ | ||
[Parameter(Mandatory = true, ValueFromPipeline = true)] | ||
[ValidateNotNullOrEmpty] | ||
public string Path { get; set; } | ||
|
||
[Parameter(Mandatory = false)] | ||
[ValidateNotNullOrEmpty] | ||
public string TemplatePath { get; set; } = ""; | ||
|
||
[Parameter()] | ||
public SwitchParameter NoRestore { get; set; } | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
var result = bicepWrapper.Build(Path, TemplatePath, NoRestore.IsPresent); | ||
WriteObject(result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters