Skip to content

Commit df5d948

Browse files
authored
Updated pipeline to latest Sampler version (#197)
* Aligned pipeline configuration with `ComputerManagementDsc` * Updates to latest Sampler version * Switched build to Windows PowerShell * Cleanup * Added task `FixEncoding` * Fixed `build.yml` and added section for 'DscResource.DocGenerator' * Removed `Write-Host` as per PSScriptAnalyzer recommendation * Removed `PSAvoidUsingWriteHost`
1 parent 13cab72 commit df5d948

File tree

8 files changed

+156
-230
lines changed

8 files changed

+156
-230
lines changed

.build/FixEncoding.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<#
2+
.SYNOPSIS
3+
Sets the encoding of all *.psd1 files to UTF8.
4+
5+
.DESCRIPTION
6+
Sets the encoding of all *.psd1 files to UTF8. This is a build task that is
7+
8+
This task is only needed when the build runs on Windows PowerShell 5.1.
9+
10+
.NOTES
11+
This is a build task that is primarily meant to be run by Invoke-Build but
12+
wrapped by the Sampler project's build.ps1 (https://github.com/gaelcolas/Sampler).
13+
#>
14+
15+
param ()
16+
17+
task FixEncoding {
18+
19+
Write-Build Yellow "Setting encoding to UTF8 for *.PSD1 files in path '$BuildModuleOutput'."
20+
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false)
21+
22+
Get-ChildItem -Path $BuildModuleOutput -Filter *.psd1 -Recurse -File | ForEach-Object {
23+
24+
Write-Build DarkGray "`t'$($_.FullName)'."
25+
$c = [System.IO.File]::ReadAllLines($_.FullName)
26+
[System.IO.File]::WriteAllLines($_.FullName, $c, $utf8NoBomEncoding)
27+
}
28+
}

.build/test.ps1

Lines changed: 0 additions & 204 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,7 @@ set to true when the LCM is already in ApplyAndAutoCorrect mode.
9999
- xHyper-V
100100
- VSTSAgent
101101
- Refactoring of SqlPermissions after upgrade of SqlServerDsc to 16.0.0
102-
- WindowsFeatures: Include support for more elaborate lists of features, giving more control
102+
- WindowsFeatures: Include support for more elaborate lists of features, giving
103+
more control.
104+
- Added task `FixEncoding` for being able to run the build on Windows PowerShell
105+
due to an encoding issue with the psd1 file.

0 commit comments

Comments
 (0)