Skip to content

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

Open
@FriedrichWeinmann

Description

@FriedrichWeinmann

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions