Skip to content

Commit 52e0723

Browse files
committed
Replaced Write-Host calls
Replaced all existing write-host calls with write-information. Updated Analyzer settings to the current expected format
1 parent 6a0cefb commit 52e0723

7 files changed

Lines changed: 37 additions & 249 deletions
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
@{
2-
Severity = @{
3-
PSAvoidUsingWriteHost = 'Warning'
4-
PSUseDeclaredVarsMoreThanAssignments = 'Warning'
5-
PSUseCorrectCasing = 'Warning'
6-
PSProvideCommentHelp = 'Information'
2+
Rules = @{
3+
PSAvoidUsingWriteHost = @{
4+
Severity = 'Warning'
5+
}
6+
PSUseDeclaredVarsMoreThanAssignments = @{
7+
Severity = 'Warning'
8+
}
9+
PSUseCorrectCasing = @{
10+
Severity = 'Warning'
11+
}
12+
PSProvideCommentHelp = @{
13+
Severity = 'Information'
14+
}
715
}
816
}

‎NewModuleTemplate.GenerateTests.ps1‎

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

‎Public/New-AnalyzerSettings.ps1‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,22 @@ function New-AnalyzerSettings {
4040
# Default analyzer configuration
4141
$content = @'
4242
@{
43-
Severity = @{
44-
PSAvoidUsingWriteHost = 'Warning'
45-
PSProvideCommentHelp = 'Information'
43+
Rules = @{
44+
PSAvoidUsingWriteHost = @{
45+
Severity = 'Warning'
46+
}
47+
PSUseDeclaredVarsMoreThanAssignments = @{
48+
Severity = 'Warning'
49+
}
50+
PSUseCorrectCasing = @{
51+
Severity = 'Warning'
52+
}
53+
PSProvideCommentHelp = @{
54+
Severity = 'Information'
55+
}
4656
}
4757
}
58+
4859
'@
4960

5061
# Write the settings file

‎Public/New-ModuleTemplate.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ function New-ModuleTemplate {
8585
Initialize-GitRepository -BasePath $base
8686
}
8787

88-
Write-Host "Module '$Name' created at $base"
88+
Write-Information "Module '$Name' created at $base"
8989
}

‎Scripts/Update-ModuleDocumentation.ps1‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Import-Module PlatyPS
2+
Import-Module "$PSScriptRoot/../NewModuleTemplate.psd1" -Force
3+
24

35
Update-MarkdownHelp `
46
-Module "$PSScriptRoot/../NewModuleTemplate.psd1" `

‎build.ps1‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ param(
44
[switch]$SkipDocs
55
)
66

7-
Write-Host "Building NewModuleTemplate..."
7+
Write-Information "Building NewModuleTemplate..."
88

99
if (-not $SkipAnalyzer) {
10-
Write-Host "Running PSScriptAnalyzer..."
10+
Write-Information "Running PSScriptAnalyzer..."
1111
Invoke-ScriptAnalyzer -Path $PSScriptRoot -Settings "$PSScriptRoot\Analyzer\PSScriptAnalyzerSettings.psd1"
1212
}
1313

1414
if (-not $SkipTests) {
15-
Write-Host "Running Pester tests..."
15+
Write-Information "Running Pester tests..."
1616
Invoke-Pester -Path "$PSScriptRoot\Tests" -EnableExit
1717
}
1818

1919
if (-not $SkipDocs) {
20-
Write-Host "Updating PlatyPS docs..."
20+
Write-Information "Updating PlatyPS docs..."
2121
Import-Module PlatyPS -ErrorAction Stop
2222
New-MarkdownHelp -Module "$PSScriptRoot\NewModuleTemplate.psd1" -OutputFolder "$PSScriptRoot\Docs" -Force
2323
}
2424

25-
Write-Host "Build complete."
25+
Write-Information "Build complete."

‎publish.ps1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ param(
77

88
$modulePath = Split-Path -Parent $PSScriptRoot
99

10-
Write-Host "Publishing NewModuleTemplate from $modulePath to $Repository..."
10+
Write-Information "Publishing NewModuleTemplate from $modulePath to $Repository..."
1111

1212
Publish-Module -Path $modulePath -Repository $Repository -NuGetApiKey $ApiKey
1313

14-
Write-Host "Publish complete."
14+
Write-Information "Publish complete."

0 commit comments

Comments
 (0)