Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -PassThru Parameter for Compress-PSResource #1702

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

jshigetomi
Copy link
Contributor

@jshigetomi jshigetomi commented Sep 12, 2024

PR Summary

This pull request introduces a new PassThru parameter to the CompressPSResource cmdlet, enabling the full path of the generated .nupkg file to be returned through the pipeline. Additionally, it includes updates to the PublishHelper class to support this new functionality and adds a test case to verify the PassThru parameter's behavior.

New Feature Addition:

  • src/code/CompressPSResource.cs: Added the PassThru parameter to the CompressPSResource 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 the PublishHelper class to handle the new PassThru parameter, including changes to the constructor and the PackNupkg method to write the .nupkg file path to the pipeline if PassThru is specified. [1] [2]

Testing:

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

@alerickson
Copy link
Member

Looks good, but -passthru should not touch the file system. It looks like right now it's displaying the pass through path but then continuing to compress the nupkg

@alerickson
Copy link
Member

/azp PowerShell.PSResourceGet

Copy link

Command 'PowerShell.PSResourceGet' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson
Copy link
Member

Nevermind! Sorry, was thinking of -WhatIf. Ignore my previous comment

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson alerickson merged commit a64c2e5 into PowerShell:master Sep 13, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants