Skip to content

Commit eac50d7

Browse files
Refactor documentation comments and suppress warnings in helper scripts
1 parent ec689a5 commit eac50d7

File tree

4 files changed

+47
-34
lines changed

4 files changed

+47
-34
lines changed

scripts/helpers/Build-PSModuleDocumentation.ps1

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
#Requires -Modules GitHub
2-
#Requires -Modules Utilities
3-
4-
function Build-PSModuleDocumentation {
1+
function Build-PSModuleDocumentation {
52
<#
6-
.SYNOPSIS
7-
Builds a module.
3+
.SYNOPSIS
4+
Builds a module.
85
9-
.DESCRIPTION
10-
Builds a module.
6+
.DESCRIPTION
7+
Builds a module.
118
#>
129
[CmdletBinding()]
1310
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1411
'PSReviewUnusedParameter', '', Scope = 'Function',
1512
Justification = 'LogGroup - Scoping affects the variables line of sight.'
1613
)]
14+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
15+
'PSAvoidUsingWriteHost', '', Scope = 'Function',
16+
Justification = 'Want to just write to the console, not the pipeline.'
17+
)]
18+
#Requires -Modules GitHub
19+
#Requires -Modules Utilities
1720
param(
1821
# Name of the module.
1922
[Parameter(Mandatory)]

scripts/helpers/Import-PSModule.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
#Requires -Modules Utilities
2-
3-
function Import-PSModule {
1+
function Import-PSModule {
42
<#
5-
.SYNOPSIS
6-
Imports a build PS module.
3+
.SYNOPSIS
4+
Imports a build PS module.
75
8-
.DESCRIPTION
9-
Imports a build PS module.
6+
.DESCRIPTION
7+
Imports a build PS module.
108
11-
.EXAMPLE
12-
Import-PSModule -SourceFolderPath $ModuleFolderPath -ModuleName $ModuleName
9+
.EXAMPLE
10+
Import-PSModule -SourceFolderPath $ModuleFolderPath -ModuleName $ModuleName
1311
14-
Imports a module located at $ModuleFolderPath with the name $ModuleName.
12+
Imports a module located at $ModuleFolderPath with the name $ModuleName.
1513
#>
1614
[CmdletBinding()]
15+
#Requires -Modules Utilities
16+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
17+
'PSAvoidUsingWriteHost', '', Scope = 'Function',
18+
Justification = 'Want to just write to the console, not the pipeline.'
19+
)]
1720
param(
1821
# Path to the folder where the module source code is located.
1922
[Parameter(Mandatory)]

scripts/helpers/Resolve-PSModuleDependency.ps1

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
#Requires -Modules Retry
2-
3-
function Resolve-PSModuleDependency {
1+
function Resolve-PSModuleDependency {
42
<#
5-
.SYNOPSIS
6-
Resolve dependencies for a module based on the manifest file.
3+
.SYNOPSIS
4+
Resolve dependencies for a module based on the manifest file.
75
8-
.DESCRIPTION
9-
Resolve dependencies for a module based on the manifest file, following PSModuleInfo structure
6+
.DESCRIPTION
7+
Resolve dependencies for a module based on the manifest file, following PSModuleInfo structure
108
11-
.EXAMPLE
12-
Resolve-PSModuleDependency -Path 'C:\MyModule\MyModule.psd1'
9+
.EXAMPLE
10+
Resolve-PSModuleDependency -Path 'C:\MyModule\MyModule.psd1'
1311
14-
Installs all modules defined in the manifest file, following PSModuleInfo structure.
12+
Installs all modules defined in the manifest file, following PSModuleInfo structure.
1513
16-
.NOTES
17-
Should later be adapted to support both pre-reqs, and dependencies.
18-
Should later be adapted to take 4 parameters sets: specific version ("requiredVersion" | "GUID"), latest version ModuleVersion,
19-
and latest version within a range MinimumVersion - MaximumVersion.
14+
.NOTES
15+
Should later be adapted to support both pre-reqs, and dependencies.
16+
Should later be adapted to take 4 parameters sets: specific version ("requiredVersion" | "GUID"), latest version ModuleVersion,
17+
and latest version within a range MinimumVersion - MaximumVersion.
2018
#>
2119
[Alias('Resolve-PSModuleDependencies')]
2220
[CmdletBinding()]
21+
#Requires -Modules Retry
22+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
23+
'PSAvoidUsingWriteHost', '', Scope = 'Function',
24+
Justification = 'Want to just write to the console, not the pipeline.'
25+
)]
2326
param(
2427
# The path to the manifest file.
2528
[Parameter(Mandatory)]

scripts/main.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
#Requires -Modules Utilities
2-
1+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
2+
'PSAvoidUsingWriteHost', '',
3+
Justification = 'Want to just write to the console, not the pipeline.'
4+
)]
35
[CmdletBinding()]
46
param()
57

8+
#Requires -Modules Utilities
9+
610
$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative
711
LogGroup "Loading helper scripts from [$path]" {
812
Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object {

0 commit comments

Comments
 (0)