Skip to content
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

Where do I place additional files? #490

Open
DennisL68 opened this issue Aug 16, 2024 · 4 comments
Open

Where do I place additional files? #490

DennisL68 opened this issue Aug 16, 2024 · 4 comments
Labels
question The issue is a question.

Comments

@DennisL68
Copy link

DennisL68 commented Aug 16, 2024

Where do I place additional static data files so that they will be part of the module such as .json, .xml, .png etc.?

I.e. files that I would normally specify in the .psd1 file of the module.

# List of all files packaged with this module
# FileList = @()

I tried adding a file by hand in the output folder, hoping that .\build.ps1 pack would include it and then including it in the manifest file, but that failed as pack cleans the output folder first.

# List of all files packaged with this module
FileList = @('files\data.json')

ERROR: Module manifest file validation failed with error: The specified FileList entry 'files\data.json' in the module manifest '...\CompleteSample\output\module\CompleteSample\0.0.1\CompleteSample.psd1' is invalid. Try again after updating this entry with valid values..

The Test-ModuleManifest .\CompleteSample.psd1 tests successfully if run before pack removes my added file from the output folder.

@johlju
Copy link
Collaborator

johlju commented Aug 17, 2024

That is not automatically supported. You can place them where you like and use CopyPaths: then update module manifest manually.

@johlju johlju added the question The issue is a question. label Aug 17, 2024
@DennisL68
Copy link
Author

But won't this be reset when I user .\build.ps pack?

@johlju
Copy link
Collaborator

johlju commented Aug 18, 2024

The module manifest is in source - you have to test if it is retained from source to output during build.

@johlju
Copy link
Collaborator

johlju commented Aug 18, 2024

During build phase you need to make the built module they way you want to have it before deploying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants