fix: Azure trust signing fails with spaces in parameters #8979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Azure trust signing fails when parameters contain spaces or special characters, breaking the build process for applications using this signing method.
How
By properly escaping PowerShell parameter values using single quotes and handling existing quotes in values.
What
''
)Technical Details
While this approach quotes all parameters, it remains compatible with the various parameter types used by
Invoke-TrustedSigning
:-Files
,-Endpoint
,-CertificateProfileName
): Properly handled with quotes to preserve spaces-FilesFolderDepth
): PowerShell automatically converts quoted values like'0'
to integers-AppendSignature
): PowerShell correctly interprets quoted boolean values ('$true'
→$true
)PowerShell's automatic type conversion ensures these quoted values are interpreted correctly, while fixing the escaping issues with spaces and special characters in paths.