Added -PassThru Parameter for Compress-PSResource #1702
Merged
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.
PR Summary
This pull request introduces a new
PassThru
parameter to theCompressPSResource
cmdlet, enabling the full path of the generated.nupkg
file to be returned through the pipeline. Additionally, it includes updates to thePublishHelper
class to support this new functionality and adds a test case to verify thePassThru
parameter's behavior.New Feature Addition:
src/code/CompressPSResource.cs
: Added thePassThru
parameter to theCompressPSResource
cmdlet, allowing the full path of the.nupkg
file to be passed through the pipeline. [1] [2]Internal Code Updates:
src/code/PublishHelper.cs
: Updated thePublishHelper
class to handle the newPassThru
parameter, including changes to the constructor and thePackNupkg
method to write the.nupkg
file path to the pipeline ifPassThru
is specified. [1] [2]Testing:
test/PublishPSResourceTests/CompressPSResource.Tests.ps1
: Added a new test case to ensure that theCompress-PSResource
cmdlet with the-PassThru
parameter correctly returns the path to the.nupkg
file.PR Context
-PassThru parameter was included in the mockup of the Compress-PSResource cmdlet but was not included in the previous PR.
This PR aims to fix that. -PassThru would be very useful for scripting Compress with Publish where the variable can be sent directly to Publish's -NupkgPath.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.