Publishing with publish-psresource requires specific folder name [3.0.0-beta10]
See original GitHub issueWhen using publish-psresource, the folder/directory name must be the same as the directory folder, and publishing from a folder with the version name will result in an error
Example:
gh:\psrapid\psrAPId> publish-psresource -path C:\Users\adrian.andersson\git\psrapid\psrAPId\1.0.1\psrAPId.psd1 -Repository powershellgetbeta -Credential $pshelf.credential -APIKey $pshelf.NuGetApiKey -verbose
Publish-PSResource: Value cannot be null. (Parameter 'path')
[14:28 | 0.02]
gh:\psrapid\psrAPId> publish-psresource -path C:\Users\adrian.andersson\git\psrapid\psrAPId\1.0.1\ -Repository powershellgetbeta -Credential $pshelf.credential -APIKey $pshelf.NuGetApiKey -verbose
Publish-PSResource: No file with a .psd1 extension was found in C:\Users\adrian.andersson\git\psrapid\psrAPId\1.0.1\1.0.1.psd1. Please specify a path to a valid modulemanifest.
Works fine if the folder name matches the psd1 name. Seems its parsing the folder name and searching for a manifest file using that name, which makes having a versioned release folder a bit more complicated
Bonus Oddness: It is possible to omit the repository name and publish-psresource will not throw an error, even if there are multiple repositories with the same priority weight
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Publishing with publish-psresource requires specific folder ...
When using publish-psresource, the folder/directory name must be the same as the directory folder, and publishing from a folder with the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Confirmed. Repro: Module file name - AzureConnectedMachineDsc.psd1 Publish-PSResource -ApiKey ‘***’ -Repository PSGallery -Path ‘/Users/username/git/AzCMAgentPublish/’ -Verbose Publish-PSResource: Value cannot be null. (Parameter ‘path’)
I was using a different folder name because I don’t want to publish every file I use in my local testing/development folder.
It doesn’t seem like a good practice to require assumptions about the folder name/structure. At minimum, the error message does not indicate what the user needs to do, so that could be corrected.
It’s broken the other way too. I used to publish with folder name:
Now it expects the file to be named 1.0.0 instead of “TerminalBlocks.psd1”: