diff --git a/Common/Invoke-gh.ps1 b/Common/Invoke-gh.ps1 index 3dc00e4c1..a365a13f5 100644 --- a/Common/Invoke-gh.ps1 +++ b/Common/Invoke-gh.ps1 @@ -14,21 +14,21 @@ function invoke-gh { [parameter(mandatory = $false, position = 1, ValueFromRemainingArguments = $true)] $remaining ) - $arguments = "$command " - $remaining | ForEach-Object { - if ("$_".IndexOf(" ") -ge 0 -or "$_".IndexOf('"') -ge 0) { - $arguments += """$($_.Replace('"','\"'))"" " + Process { + $arguments = "$command " + foreach($parameter in $remaining) { + if ("$parameter".IndexOf(" ") -ge 0 -or "$parameter".IndexOf('"') -ge 0) { + if ($parameter.length -gt 15000) { + $parameter = "$($parameter.Substring(0,15000))...`n`n**Truncated due to size limits!**" + } + $arguments += """$($parameter.Replace('"','\"'))"" " + } + else { + $arguments += "$parameter " + } } - else { - $arguments += "$_ " - } - } - try { cmdDo -command gh -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr } - catch [System.Management.Automation.MethodInvocationException] { - throw "It looks like GitHub CLI is not installed. Please install GitHub CLI from https://cli.github.com/" - } } Export-ModuleMember -Function Invoke-gh diff --git a/Common/Invoke-git.ps1 b/Common/Invoke-git.ps1 index f959a30a9..a27123b70 100644 --- a/Common/Invoke-git.ps1 +++ b/Common/Invoke-git.ps1 @@ -14,20 +14,17 @@ function invoke-git { [parameter(mandatory = $false, position = 1, ValueFromRemainingArguments = $true)] $remaining ) - $arguments = "$command " - $remaining | ForEach-Object { - if ("$_".IndexOf(" ") -ge 0 -or "$_".IndexOf('"') -ge 0) { - $arguments += """$($_.Replace('"','\"'))"" " + Process { + $arguments = "$command " + foreach($parameter in $remaining) { + if ("$parameter".IndexOf(" ") -ge 0 -or "$parameter".IndexOf('"') -ge 0) { + $arguments += """$($parameter.Replace('"','\"'))"" " + } + else { + $arguments += "$parameter " + } } - else { - $arguments += "$_ " - } - } - try { cmdDo -command git -arguments $arguments -silent:$silent -returnValue:$returnValue -inputStr $inputStr } - catch [System.Management.Automation.MethodInvocationException] { - throw "It looks like Git is not installed. Please install Git from https://git-scm.com/download" - } } Export-ModuleMember -Function Invoke-git diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 2e3be250a..5e56ad3e1 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -4,6 +4,8 @@ The insider SAS token is still supported until April 2024 where the last insider Remove the need for Insider SAS token in Create Container wizard and Create AL-Go repo wizard Add parameter EnableExternalRulesets to Run-AlPipeline (which will be added to the compiler when compiling) Issue https://github.com/microsoft/AL-Go/issues/709 Include unknown app dependencies from previous apps (which doesn't already exist in unknown app dependencies) +Do not hide real exception in invoke-git and invoke-gh +Truncate body part to 15000 characters in invoke-gh 5.0.7 Run-AlValidation also needs to install NAVSIP dependencies (issue #3190)