Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…, Fixes #1106 )

Fixing protocol parameter alias (trigger by build keyword)
  • Loading branch information
James Brundage committed Apr 15, 2024
2 parents f08debf + 002c03e commit 7614b6e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion Commands/Protocols/HTTP-Protocol.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[ValidatePattern("(?>HTTP|Protocol)")]
param()


function Protocol.HTTP {

Expand Down Expand Up @@ -103,7 +106,15 @@ function Protocol.HTTP {
# The invocation command. By default, Invoke-RestMethod.
# Whatever alternative command provided should have a similar signature to Invoke-RestMethod.
[string]
$Invoker = 'Invoke-RestMethod'
$Invoker = 'Invoke-RestMethod',

[Alias('Expand Property')]
[string]
$ExpandProperty,

[Alias('Property')]
[string[]]
$Property
)

process {
Expand Down Expand Up @@ -231,6 +242,15 @@ function Protocol.HTTP {
$param.Value
}
}


if ($ExpandProperty -or $Property) {
if ($property -and -not $ExpandProperty) {
" | Select-Object -Property $(@(
) -join ',')"
}
}
) -join ' '

[scriptblock]::Create($newScript)
Expand Down
2 changes: 1 addition & 1 deletion PipeScript.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
CompanyName = 'Start-Automating'
Copyright = '2022-2024 Start-Automating'
Author = 'James Brundage'
FunctionsToExport = 'Tech.Jekyll','Tech.Hugo','Language.GLSL','Language.XML','Language.Lua','Language.Arduino','Language.LaTeX','Language.Dart','Template.HelloWorld.dart','Language.Cuda','Language.Rust','Language.GCode','Language.WebAssembly','Language.CPlusPlus','Template.HelloWorld.cpp','Template.Include.cpp','Language.JavaScript','Template.HelloWorld.js','Template.Assignment.js','Template.Class.js','Template.DoLoop.js','Template.ForeachArgument.js','Template.ForEachLoop.js','Template.ForLoop.js','Template.Function.js','Template.InvokeMethod.js','Template.RegexLiteral.js','Template.TryCatch.js','Template.WhileLoop.js','Language.Wren','Template.HelloWorld.wren','Language.Liquid','Language.CSS','Language.ATOM','Language.Razor','Language.XSD','Language.JSON','Language.Bicep','Language.XAML','Language.CSharp','Template.Class.cs','Template.HelloWorld.cs','Template.Method.cs','Template.Namespace.cs','Template.Property.cs','Template.TryCatch.cs','Language.SQL','Language.Markdown','Language.Eiffel','Language.BrightScript','Language.FSharp','Language.YAML','Language.Ruby','Template.HelloWorld.rb','Language.ADA','Language.Pug','Language.TCL','Language.RSS','Language.Crystal','Template.HelloWorld.cr','Language.Racket','Language.Go','Template.HelloWorld.go','Language.PHP','Language.HCL','Language.XSL','Language.ObjectiveC','Language.Kotlin','Language.HTML','Template.HelloWorld.html','Template.HTML.CustomElement','Template.HTML.Command.Input','Template.HTML.InputElement','Template.HTML.Parameter.Input','Template.HTML.Element','Template.HTML.Script','Template.HTML.StyleSheet','Template.HTML.Default.Layout','Language.Haxe','Language.C','Template.Include.c','Language.C3','Language.Perl','Language.OpenSCAD','Language.Conf','Language.Batch','Template.Batch.Wrapper','Language.SVG','Language.Scala','Language.Bash','Template.Bash.Wrapper','Language.Docker','Template.Docker.InstallModule','Template.Docker.InstallPackage','Template.Docker.LabelModule','Template.Docker.Add','Template.Docker.Argument','Template.Docker.Command','Template.Docker.CopyItem','Template.Docker.EntryPoint','Template.Docker.Expose','Template.Docker.From','Template.Docker.HealthCheck','Template.Docker.Label','Template.Docker.OnBuild','Template.Docker.Run','Template.Docker.SetLocation','Template.Docker.SetShell','Template.Docker.SetUser','Template.Docker.SetVariable','Template.Docker.StopSignal','Template.Docker.Volume','Language.PipeScript','Template.PipeScript.ExplicitOutput','Template.PipeScript.Inherit','Template.PipeScript.OutputFile','Template.PipeScript.ProxyCommand','Template.PipeScript.Rest','Template.PipeScript.Dot','Template.PipeScript.DoubleDot','Template.PipeScript.DoubleEqualCompare','Template.PipeScript.NamespacedAlias','Template.PipeScript.NamespacedObject','Template.PipeScript.PipedAssignment','Template.PipeScript.SwitchAsIs','Template.PipeScript.TripleEqualCompare','Template.PipeScript.WhereMethod','Language.BASIC','Language.PowerShell','Language.PowerShellData','Language.PowerShellXML','Template.PowerShell.RemoveParameter','Template.PowerShell.RenameVariable','Template.PowerShell.Attribute','Template.PowerShell.Help','Template.PowerShell.Parameter','Language.Vue','Language.Python','Template.HelloWorld.py','Template.Import.py','Template.Assignment.py','Template.DoLoop.py','Template.ForeachArgument.py','Template.UntilLoop.py','Template.WhileLoop.py','Language.Kusto','Language.TOML','Language.Java','Language.TypeScript','Template.HelloWorld.ts','Language.R','Language.HLSL','Get-Transpiler','Start-PSNode','Import-ModuleMember','Export-Json','Import-Json','Out-JSON','Get-Interpreter','Invoke-Interpreter','Serve.Asset','Serve.Command','Serve.Module','Serve.Variable','Aspect.DynamicParameter','Aspect.ModuleExtensionType','Aspect.ModuleExtensionPattern','Aspect.ModuleExtensionCommand','Aspect.GroupObjectByTypeName','Aspect.GroupObjectByType','Route.Uptime','Route.VersionInfo','Protocol.HTTP','Protocol.JSONSchema','Protocol.OpenAPI','Protocol.UDP','PipeScript.Automatic.Variable.IsPipedTo','PipeScript.Automatic.Variable.IsPipedFrom','PipeScript.Automatic.Variable.MyCallstack','PipeScript.Automatic.Variable.MySelf','PipeScript.Automatic.Variable.MyParameters','PipeScript.Automatic.Variable.MyCaller','PipeScript.Automatic.Variable.MyCommandAst','ConvertFrom-CliXml','ConvertTo-CliXml','PipeScript.Optimizer.ConsolidateAspects','Out-HTML','Out-Parser','Parse.CSharp','Parse.PowerShell','Signal.Nothing','Signal.Out','PipeScript.PostProcess.InitializeAutomaticVariables','PipeScript.PostProcess.PartialFunction','Export-Pipescript','Get-PipeScript','Import-PipeScript','Invoke-PipeScript','Join-PipeScript','New-PipeScript','Search-PipeScript','Update-PipeScript','Use-PipeScript','Search-Command','Compile.LanguageDefinition'
FunctionsToExport = 'Language.Razor','Language.Docker','Template.Docker.InstallModule','Template.Docker.InstallPackage','Template.Docker.LabelModule','Template.Docker.Add','Template.Docker.Argument','Template.Docker.Command','Template.Docker.CopyItem','Template.Docker.EntryPoint','Template.Docker.Expose','Template.Docker.From','Template.Docker.HealthCheck','Template.Docker.Label','Template.Docker.OnBuild','Template.Docker.Run','Template.Docker.SetLocation','Template.Docker.SetShell','Template.Docker.SetUser','Template.Docker.SetVariable','Template.Docker.StopSignal','Template.Docker.Volume','Language.JavaScript','Template.HelloWorld.js','Template.Assignment.js','Template.Class.js','Template.DoLoop.js','Template.ForeachArgument.js','Template.ForEachLoop.js','Template.ForLoop.js','Template.Function.js','Template.InvokeMethod.js','Template.RegexLiteral.js','Template.TryCatch.js','Template.WhileLoop.js','Language.RSS','Language.ADA','Language.Scala','Language.Arduino','Language.FSharp','Language.CPlusPlus','Template.HelloWorld.cpp','Template.Include.cpp','Language.XSD','Language.Pug','Language.XML','Language.Rust','Language.BASIC','Language.Liquid','Language.Kotlin','Language.OpenSCAD','Language.ObjectiveC','Language.Kusto','Language.XSL','Language.BrightScript','Language.Ruby','Template.HelloWorld.rb','Language.PowerShell','Language.PowerShellData','Language.PowerShellXML','Template.PowerShell.RemoveParameter','Template.PowerShell.RenameVariable','Template.PowerShell.Attribute','Template.PowerShell.Help','Template.PowerShell.Parameter','Language.Batch','Template.Batch.Wrapper','Language.SQL','Language.XAML','Language.LaTeX','Language.Perl','Language.HLSL','Language.TypeScript','Template.HelloWorld.ts','Language.PipeScript','Template.PipeScript.ExplicitOutput','Template.PipeScript.Inherit','Template.PipeScript.OutputFile','Template.PipeScript.ProxyCommand','Template.PipeScript.Rest','Template.PipeScript.Dot','Template.PipeScript.DoubleDot','Template.PipeScript.DoubleEqualCompare','Template.PipeScript.NamespacedAlias','Template.PipeScript.NamespacedObject','Template.PipeScript.PipedAssignment','Template.PipeScript.SwitchAsIs','Template.PipeScript.TripleEqualCompare','Template.PipeScript.WhereMethod','Language.Haxe','Language.TOML','Language.Dart','Template.HelloWorld.dart','Language.GLSL','Language.Racket','Language.Crystal','Template.HelloWorld.cr','Language.SVG','Language.Eiffel','Language.PHP','Language.Markdown','Language.Go','Template.HelloWorld.go','Language.HTML','Template.HelloWorld.html','Template.HTML.Command.Input','Template.HTML.InputElement','Template.HTML.Parameter.Input','Template.HTML.Element','Template.HTML.Script','Template.HTML.StyleSheet','Template.HTML.Default.Layout','Template.HTML.CustomElement','Language.Cuda','Language.WebAssembly','Language.Wren','Template.HelloWorld.wren','Language.Vue','Language.YAML','Language.Conf','Language.R','Language.Lua','Language.Bicep','Language.TCL','Language.C3','Language.ATOM','Language.Java','Language.HCL','Language.CSharp','Template.Class.cs','Template.HelloWorld.cs','Template.Method.cs','Template.Namespace.cs','Template.Property.cs','Template.TryCatch.cs','Language.GCode','Language.Python','Template.HelloWorld.py','Template.Import.py','Template.Assignment.py','Template.DoLoop.py','Template.ForeachArgument.py','Template.UntilLoop.py','Template.WhileLoop.py','Language.C','Template.Include.c','Language.CSS','Language.JSON','Language.Bash','Template.Bash.Wrapper','Get-Transpiler','Start-PSNode','Compile.LanguageDefinition','ConvertFrom-CliXml','ConvertTo-CliXml','Route.Uptime','Route.VersionInfo','Signal.Nothing','Signal.Out','PipeScript.Optimizer.ConsolidateAspects','Get-Interpreter','Invoke-Interpreter','Search-Command','Import-ModuleMember','Serve.Asset','Serve.Command','Serve.Module','Serve.Variable','Export-Pipescript','Get-PipeScript','Import-PipeScript','Invoke-PipeScript','Join-PipeScript','New-PipeScript','Search-PipeScript','Update-PipeScript','Use-PipeScript','PipeScript.PostProcess.InitializeAutomaticVariables','PipeScript.PostProcess.PartialFunction','Aspect.DynamicParameter','Aspect.ModuleExtensionType','Aspect.ModuleExtensionPattern','Aspect.ModuleExtensionCommand','Aspect.GroupObjectByTypeName','Aspect.GroupObjectByType','Out-Parser','Parse.CSharp','Parse.PowerShell','Out-HTML','Protocol.HTTP','Protocol.JSONSchema','Protocol.OpenAPI','Protocol.UDP','PipeScript.Automatic.Variable.IsPipedTo','PipeScript.Automatic.Variable.IsPipedFrom','PipeScript.Automatic.Variable.MyCallstack','PipeScript.Automatic.Variable.MySelf','PipeScript.Automatic.Variable.MyParameters','PipeScript.Automatic.Variable.MyCaller','PipeScript.Automatic.Variable.MyCommandAst','Export-Json','Import-Json','Out-JSON','Tech.Hugo','Tech.Jekyll'
PrivateData = @{
FunctionTypes = @{
'Partial' = @{
Expand Down

0 comments on commit 7614b6e

Please sign in to comment.