Misc/Invoke-gh.ps1
<#
.Synopsis PREVIEW: Invoke gh command with parameters .Description Requires Github CLI installed #> function invoke-gh { Param( [switch] $silent, [switch] $returnValue, [parameter(mandatory = $true, position = 0)][string] $command, [parameter(mandatory = $false, position = 1, ValueFromRemainingArguments = $true)] $remaining ) $arguments = "$command " $remaining | ForEach-Object { if ("$_".IndexOf(" ") -ge 0 -or "$_".IndexOf('"') -ge 0) { $arguments += """$($_.Replace('"','\"'))"" " } else { $arguments += "$_ " } } cmdDo -command gh -arguments $arguments -silent:$silent -returnValue:$returnValue } Export-ModuleMember -Function Invoke-gh |