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

Fix New-ModuleManifest encoding in What's New 6.0 #2048

Merged
merged 1 commit into from
Mar 23, 2018

Conversation

matt9ucci
Copy link
Contributor

@sdwheeler I am not sure whether it is a documentation bug or a software bug. If it is a software bug, please close this PR.

According to the New-ModuleManifest.md:

  • New-ModuleManifest does not have Encoding parameter
  • The encoding of the module manifest (.psd1) file created with New-ModuleManifest cmdlet depends on environment: if it is PowerShell Core running on Linux then encoding is UTF-8 (no BOM); otherwise encoding is UTF-16 (with BOM)

See NewModuleManifestCommand.cs and the following test commands:

Windows:

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0
PSEdition                      Core
GitCommitId                    v6.0.0
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS> New-ModuleManifest -Path .\test.psd1
PS> '{0:X2}' -f (Get-Content -AsByteStream -Path .\test.psd1 -ReadCount 8 -TotalCount 8)
FF FE 23 00 0D 00 0A 00

Linux:

PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0
PSEdition                      Core
GitCommitId                    v6.0.0
OS                             Linux 4.4.108-boot2docker #1 SMP Wed Dec 27 23:32:59 UTC 2017
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


PS /> New-ModuleManifest -Path .\test.psd1
PS /> '{0:X2}' -f (Get-Content -AsByteStream -Path .\test.psd1 -ReadCount 8 -TotalCount 8)
23 0A 23 20 4D 6F 64 75

FF FE indicates BOM UTF-16 little-endian (Windows).
23 0A 23 ... indicates NoBOM (Linux).
See The Unicode Consortium FAQ.

Version(s) of document impacted

  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not updating all version of documents

  • The documented feature was introduced in version 6.0 of PowerShell
  • This issue only shows up in version (list version(s) here) of the document
  • This PR partially fixes the issue, and issue # tracks the remaining work

@saldana
Copy link
Contributor

saldana commented Jan 12, 2018

✅ Validation status: passed

File Status Preview URL Details
reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-Core-60.md ✅Succeeded

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@sdwheeler
Copy link
Contributor

@joeyaiello Can you review Matt's comments here. Is this a bug in New-ModuleManifest?

@SteveL-MSFT
Copy link
Contributor

The content is correct. Unfortunately I didn't notice with the encoding changes that New-ModuleManifest was still outputting UTF-16 BOM on Windows. PowerShell/PowerShell#5923 fixes this to be UTF-8 everywhere, but didn't make it in time for 6.0.0. So in 6.1.0 it'll be UTF-8. I'll leave it to you @sdwheeler to figure out how to address that in the docs in 6.1.0 timeframe.

@sdwheeler sdwheeler merged commit 527f64e into MicrosoftDocs:staging Mar 23, 2018
@matt9ucci matt9ucci deleted the patch-WhatsNew6-nmm branch March 24, 2018 00:39
sdwheeler pushed a commit that referenced this pull request Mar 27, 2018
* Fix New-ModuleManifest encoding in What's New 6.0 (#2048)

* Date and spaces updates [M1] (#2215)

* Date and spaces updates [M0] (#2214)

* Date and spaces updates [M0]

* Fixed for PlatyPS

* Date and spaces updates [M2] (#2216)

* Date and spaces updates [M3] (#2217)

* Date and spaces updates [M4] (#2218)

* Add newlines (#2219)

* Date and spaces updates [Tu0] (#2221)

* Date and spaces updates [Tu2] (#2223)

* Date and spaces updates [Tu1] (#2222)

* Date and spaces updates [Tu3] (#2224)

* Date and spaces updates [Tu4] (#2225)

* Date and spaces updates [Tu4]

* Fixed example and for PlatyPS
sdwheeler pushed a commit that referenced this pull request Mar 28, 2018
* Fix New-ModuleManifest encoding in What's New 6.0 (#2048)

* Date and spaces updates [M1] (#2215)

* Date and spaces updates [M0] (#2214)

* Date and spaces updates [M0]

* Fixed for PlatyPS

* Date and spaces updates [M2] (#2216)

* Date and spaces updates [M3] (#2217)

* Date and spaces updates [M4] (#2218)

* Add newlines (#2219)

* Date and spaces updates [Tu0] (#2221)

* Date and spaces updates [Tu2] (#2223)

* Date and spaces updates [Tu1] (#2222)

* Date and spaces updates [Tu3] (#2224)

* Date and spaces updates [Tu4] (#2225)

* Date and spaces updates [Tu4]

* Fixed example and for PlatyPS

* Importing `xVirtualMachine` (#2232)

- Not: `TestCompositeResource`; which isn't mentioned anywhere in this document.

* $PSVersionTable.Platform returns Unix on macOS (#2227)

Fix PowerShell/PowerShell#6513

* Date and spaces updates [W0] (#2234)

* Date and spaces updates [W1] (#2235)

* Date and spaces updates [W2] (#2236)

* Date and spaces updates [W3] (#2237)

* Date and spaces updates [W4] (#2238)
sdwheeler pushed a commit that referenced this pull request Mar 28, 2018
* Fix New-ModuleManifest encoding in What's New 6.0 (#2048)

* Date and spaces updates [M1] (#2215)

* Date and spaces updates [M0] (#2214)

* Date and spaces updates [M0]

* Fixed for PlatyPS

* Date and spaces updates [M2] (#2216)

* Date and spaces updates [M3] (#2217)

* Date and spaces updates [M4] (#2218)

* Add newlines (#2219)

* Date and spaces updates [Tu0] (#2221)

* Date and spaces updates [Tu2] (#2223)

* Date and spaces updates [Tu1] (#2222)

* Date and spaces updates [Tu3] (#2224)

* Date and spaces updates [Tu4] (#2225)

* Date and spaces updates [Tu4]

* Fixed example and for PlatyPS

* Importing `xVirtualMachine` (#2232)

- Not: `TestCompositeResource`; which isn't mentioned anywhere in this document.

* $PSVersionTable.Platform returns Unix on macOS (#2227)

Fix PowerShell/PowerShell#6513

* Date and spaces updates [W0] (#2234)

* Date and spaces updates [W1] (#2235)

* Date and spaces updates [W2] (#2236)

* Date and spaces updates [W3] (#2237)

* Date and spaces updates [W4] (#2238)

* Date and spaces updates [W5] (#2240)

* Date and spaces updates [W6] (#2241)

* Date and spaces updates [W10] (#2245)

* Date and spaces updates [W9] (#2244)

* Date and spaces updates [W7] (#2242)

* Date and spaces updates [W11] (#2246)

* Date and spaces updates [W8] (#2243)

* Date and spaces updates [W8]

* Example and PlatyPS fixes

* Date and spaces updates [W12] (#2247)

* Date and spaces updates [W13] (#2248)

* Date and spaces updates [W14] (#2249)

* Date and spaces updates [W14]

* Cleanup and PlatyPS fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants