-
Notifications
You must be signed in to change notification settings - Fork 99
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
Conversation
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>
|
/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). |
|
for issue #1819 can we add a test, by publishing the created module to the gallery and saving/installing it from there |
|
I don't really think it's necessary to publish to the Gallery because the issue isn't with publishing it's with the act of packing/compressing. The method |
Summary
Fixes #1882 and #1819
Compress-PSResourcewas 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-PSResourcewas excluding:.(dotfiles like.gitkeep,.gitignore,.editorconfig)This caused issues in the following scenario:
.gitkeepfiles (empty or non-empty) in directories likePublic/orPrivate/Compress-PSResourcecreates a.nupkgbut excludes the.gitkeepfilesSolution
Added
NoDefaultExcludes = trueto thePackArgsinPublishHelper.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:
.gitkeepfiles are now included.gitkeepfiles are now included with correct content.gitignore,.editorconfig) are now included.vscode) are now includedAlso added a test case in
CompressPSResource.Tests.ps1to verify.gitkeepfiles (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.