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

Update-ModuleManifest complains when adding an invalid entry value, yet still updates the manifest. #8389

Open
mklement0 opened this Issue Dec 3, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@mklement0
Contributor

mklement0 commented Dec 3, 2018

This is a regression from Windows PowerShell.

I've only tried with one entry, RootModule, where the bug only surfaces if the input manifest file does not have the entry being updated yet.

Steps to reproduce

# Important: create the manifest *without* -RootModule
New-ModuleManifest tmp.psd1
# Try to update (add) the RootModule entry with an invalid value.
Update-ModuleManifest tmp.psd1 -RootModule '\/'
'---'
# Extract the now-current RootModule entry.
Select-String ^RootModule tmp.psd1

Expected behavior

Microsoft.PowerShell.Core\Test-ModuleManifest : The module manifest '\/' could not be processed because it is not a valid PowerShell module manifest file.
...
---

That is, an error should be reported, and the manifest file should remain unaltered, i.e., still have no RootModule entry.

Actual behavior

Microsoft.PowerShell.Core\Test-ModuleManifest : The module manifest '\/' could not be processed because it is not a valid PowerShell module manifest file.
...
---

tmp.psd1:12:RootModule = '\/'

That is, the manifest file was unexpectedly still updated with the invalid entry.

Environment data

PowerShell Core 6.2.0-preview.1 on macOS 10.14.1
PowerShell Core 6.2.0-preview.1 on Ubuntu 16.04.5 LTS
PowerShell Core 6.2.0-preview.1 on Microsoft Windows 10 Pro (64-bit; Version 1803, OS Build: 17134.345)

@mklement0 mklement0 changed the title from Update-ModuleManifest complains about an invalid entry, yet still updates the manifest. to Update-ModuleManifest complains when adding an invalid entry value, yet still updates the manifest. Dec 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment