Skip to content

Commit 2f91df3

Browse files
committed
fix: make sure generated manifest is UTF-8 without BOM
1 parent f10c530 commit 2f91df3

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Templates/Dotnet/ModuleBuilderModule/dotnet-post-action.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
#>
55
Set-StrictMode -Version Latest
66

7-
# Generate manifest
8-
New-ModuleManifest -RootModule "{moduleName}" -Path "./Source/{moduleName}.psd1" -ModuleVersion 0.0.1
7+
# generate manifest
8+
$manifestPath = "./Source/{moduleName}.psd1"
9+
New-ModuleManifest -RootModule "{moduleName}" -Path $manifestPath -ModuleVersion 0.0.1
910

10-
# Remove self
11+
# convert manifest to UTF-8 without BOM
12+
$content = Get-Content $manifestPath
13+
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
14+
[System.IO.File]::WriteAllLines($manifestPath, $content, $Utf8NoBomEncoding)
15+
16+
# delete self
1117
Remove-Item ./dotnet-post-action.ps1

0 commit comments

Comments
 (0)