This pull request introduces changes to the Compress-PSResource functionality, including updates to the PublishHelper.cs file and the corresponding tests in CompressPSResource.Tests.ps1. The primary focus is on enhancing the compression process and ensuring it works correctly with both absolute and relative paths.
Enhancements to Compress-PSResource functionality:
src/code/PublishHelper.cs: Added logic to set the outputNupkgDir to DestinationPath when the caller cmdlet is CompressPSResource. ([src/code/PublishHelper.csR297-R301](diffhunk://#diff-de173e5cd669c3f87b931f1b38ebaa7633861e9c809176f0cec1735585d68549R297-R301))
Updates to tests:
test/PublishPSResourceTests/CompressPSResource.Tests.ps1: Added a new test case to verify the compression of a script into a .nupkg file. ([test/PublishPSResourceTests/CompressPSResource.Tests.ps1R194-R244](diffhunk://#diff-8214d34f8b6d7fd40d95dab82c9c569dd62919c12ac16e599af4255985a15cb7R194-R244))
test/PublishPSResourceTests/CompressPSResource.Tests.ps1: Added a test case to ensure that Compress-PSResource works correctly when using relative paths for the -DestinationPath parameter. ([test/PublishPSResourceTests/CompressPSResource.Tests.ps1R194-R244](diffhunk://#diff-8214d34f8b6d7fd40d95dab82c9c569dd62919c12ac16e599af4255985a15cb7R194-R244))
If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
PR Summary
fixes: #1715
This pull request introduces changes to the
Compress-PSResource
functionality, including updates to thePublishHelper.cs
file and the corresponding tests inCompressPSResource.Tests.ps1
. The primary focus is on enhancing the compression process and ensuring it works correctly with both absolute and relative paths.Enhancements to
Compress-PSResource
functionality:src/code/PublishHelper.cs
: Added logic to set theoutputNupkgDir
toDestinationPath
when the caller cmdlet isCompressPSResource
. ([src/code/PublishHelper.csR297-R301](diffhunk://#diff-de173e5cd669c3f87b931f1b38ebaa7633861e9c809176f0cec1735585d68549R297-R301)
)Updates to tests:
test/PublishPSResourceTests/CompressPSResource.Tests.ps1
: Added a new test case to verify the compression of a script into a.nupkg
file. ([test/PublishPSResourceTests/CompressPSResource.Tests.ps1R194-R244](diffhunk://#diff-8214d34f8b6d7fd40d95dab82c9c569dd62919c12ac16e599af4255985a15cb7R194-R244)
)test/PublishPSResourceTests/CompressPSResource.Tests.ps1
: Added a test case to ensure thatCompress-PSResource
works correctly when using relative paths for the-DestinationPath
parameter. ([test/PublishPSResourceTests/CompressPSResource.Tests.ps1R194-R244](diffhunk://#diff-8214d34f8b6d7fd40d95dab82c9c569dd62919c12ac16e599af4255985a15cb7R194-R244)
)PR Context
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.