Skip to content

Save-PSResource & Install-PSResource do not include empty files & folders #1819

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

Open
3 tasks done
FriedrichWeinmann opened this issue May 7, 2025 · 0 comments
Open
3 tasks done
Labels
Area-Install Issue-Bug Something isn't working

Comments

@FriedrichWeinmann
Copy link
Contributor

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Tested against a fileshare based repository

Empty folders and empty files - and empty folders containing nothing but empty files - are not installed / deployed.
Manually unwrapping the .nupkg files proves they were correctly included in the publishing and only go AWOL on install/deployment.

If a module is then built on a template that also includes empty folders, where files within are dynamically included at import (if any), and published, it will generate an error in import, as it tries to enumerate a folder that does not exist.

Expected behavior

Install-Module ContosoTools -Repository local
Import-Module ContosoTools
#-> No errors

Actual behavior

Install-Module ContosoTools -Repository local
Import-Module ContosoTools
# Error: Get-ChildItem: Cannot find path '<documents>\PowerShell\Modules\ContosoTools\1.0.0\internal\'

Error details

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.1                 Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-Install…


Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Install Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants