-
Notifications
You must be signed in to change notification settings - Fork 100
Fix Compress-PSResource ignoring .gitkeep and other dotfiles #1889
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
Draft
Copilot
wants to merge
7
commits into
master
Choose a base branch
from
copilot/fix-compress-psresource-issue-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
…d files Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
Copilot finished work on behalf of
alerickson
October 7, 2025 20:04
/azp run PowerShell.PSResourceGet |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run PowerShell.PSResourceGet |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run PowerShell.PSResourceGet |
Azure Pipelines successfully started running 1 pipeline(s). |
alerickson
approved these changes
Oct 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #1882 and #1819
Compress-PSResource
was ignoring certain files and folders due to NuGet's default exclusion patterns, causing signature validation failures when modules included file catalogs.Problem
When compressing a module for publishing,
Compress-PSResource
was excluding:.
(dotfiles like.gitkeep
,.gitignore
,.editorconfig
)This caused issues in the following scenario:
.gitkeep
files (empty or non-empty) in directories likePublic/
orPrivate/
Compress-PSResource
creates a.nupkg
but excludes the.gitkeep
filesSolution
Added
NoDefaultExcludes = true
to thePackArgs
inPublishHelper.cs
. This disables NuGet's default file exclusion behavior, ensuring all files in the module directory are included in the compressed package.Change in
src/code/PublishHelper.cs
:Verification
Manually tested to confirm:
.gitkeep
files are now included.gitkeep
files are now included with correct content.gitignore
,.editorconfig
) are now included.vscode
) are now includedAlso added a test case in
CompressPSResource.Tests.ps1
to verify.gitkeep
files (both empty and non-empty) are included in compressed packages.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
1k9vsblobprodcus379.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)37cvsblobprodcus359.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)4myvsblobprodcus32.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)51yvsblobprodcus36.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)5dkvsblobprodcus355.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)7devsblobprodcus323.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)7k6vsblobprodcus337.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)7tjvsblobprodcus341.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)bcnvsblobprodcus378.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)c50vsblobprodcus330.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)c78vsblobprodcus322.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)dlbvsblobprodcus316.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)fdpvsblobprodcus345.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)gbsvsblobprodcus365.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)jd4vsblobprodcus366.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)kh4vsblobprodcus325.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)kmuvsblobprodcus389.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)l49vsblobprodcus358.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)m6xvsblobprodcus342.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)pkvvsblobprodcus321.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)s4uvsblobprodcus326.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)tphvsblobprodcus375.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)uy6vsblobprodcus34.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)yttvsblobprodcus357.vsblob.vsassets.io
/usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.