Skip to content

Commit f4f16ef

Browse files
committed
CmdLet is working in principle
1 parent 56dd782 commit f4f16ef

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<RootNamespace>codingfreaks.PoshBicepLint</RootNamespace>
4+
<AssemblyName>PoshBicepLint</AssemblyName>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"profiles": {
3+
"PowerShell": {
4+
"commandName": "Executable",
5+
"executablePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
6+
"commandLineArgs": "-NoExit -Command \"Import-Module '$(TargetDir)PoshBicepLint.dll';Start-BicepLint -Message 'World'\"",
7+
"workingDirectory": "$(ProjectDir)"
8+
}
9+
}
10+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace codingfreaks.PoshBicepLint
2+
{
3+
using System.Management.Automation;
4+
5+
[Cmdlet(VerbsLifecycle.Start, "BicepLint")]
6+
[OutputType(typeof(string))]
7+
public class StartBicepLint : PSCmdlet
8+
{
9+
#region methods
10+
11+
[Parameter(Mandatory = true, ValueFromPipeline = true)]
12+
public string Message { get; set; } = null!;
13+
14+
/// <inheritdoc />
15+
protected override void ProcessRecord()
16+
{
17+
WriteObject($"Hello: {Message}");
18+
base.ProcessRecord();
19+
}
20+
21+
#endregion
22+
}
23+
}

PoshBicepLint/PoshBicepLint.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="BicepLinter/BicepLinter.csproj" Id="902c390a-5aca-450b-9f76-50dfc68af9d8" />
3+
</Solution>

0 commit comments

Comments
 (0)