Skip to content

Commit 3492e6b

Browse files
committed
PSUseApprovedVerbs
1 parent 008b23b commit 3492e6b

13 files changed

Lines changed: 48 additions & 118 deletions

File tree

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@
8080
"label": "Insert Missing Comment Based Help",
8181
"type": "shell",
8282
"windows": {
83-
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
83+
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
8484
},
8585
"linux": {
86-
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
86+
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
8787
},
8888
"osx": {
89-
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
89+
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
9090
},
9191
"group": {
9292
"kind": "build",

Build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param (
1212
[parameter(Position = 5, ParameterSetName = 'Build')]
1313
[string]$ReleaseNotes,
1414
[parameter(Position = 6, ParameterSetName = 'CBH')]
15-
[switch]$InsertCBH
15+
[switch]$AddCBH
1616
)
1717

1818
function PrerequisitesLoaded {
@@ -53,9 +53,9 @@ if (-not (PrerequisitesLoaded)) {
5353

5454
switch ($psCmdlet.ParameterSetName) {
5555
'CBH' {
56-
if ($InsertCBH) {
56+
if ($AddCBH) {
5757
try {
58-
Invoke-Build -Task InsertMissingCBH
58+
Invoke-Build -Task AddMissingCBH
5959
}
6060
catch {
6161
throw

ModuleBuild.build.ps1

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
param (
23
[parameter(Position = 0)]
34
[string]$BuildFile = @(Get-ChildItem 'build\*.buildenvironment.ps1')[0].FullName,
@@ -176,12 +177,6 @@ task CodeHealthReport -if {$Script:BuildEnv.OptionCodeHealthReport} ValidateRequ
176177
}
177178
}
178179

179-
#Synopsis: Validate script requirements are met, load required modules, load project manifest and module, and load additional build tools.
180-
task Configure ValidateRequirements, PreBuildTasks, LoadRequiredModules, LoadModuleManifest, LoadModule, VersionCheck, LoadBuildTools, {
181-
# If we made it this far then we are configured!
182-
Write-Description White 'Configuring build environment' -accent
183-
}
184-
185180
# Synopsis: Set a new version of the module
186181
task NewVersion LoadBuildTools, LoadModuleManifest, {
187182
Write-Description White 'Updating module build version' -accent
@@ -241,9 +236,6 @@ task UpdateRelease LoadBuildTools, LoadModuleManifest, {
241236
}
242237
}
243238

244-
# Synopsis: Update the current working module version and release notes
245-
task UpdateVersion NewVersion, UpdateRelease
246-
247239
# Synopsis: Regenerate scratch staging directory
248240
task Clean {
249241
Write-Description White "Clean up our scratch/staging directory $($Script:BuildEnv.ScratchFolder)" -accent
@@ -481,8 +473,6 @@ task AnalyzePublic {
481473
$Analysis | Format-Table -AutoSize
482474
}
483475
}
484-
# Synopsis: Build help files for module
485-
task CreateHelp CreateMarkdownHelp, CreateExternalHelp, CreateUpdateableHelpCAB, CreateProjectHelp, AddAdditionalDocFiles
486476

487477
# Synopsis: Build the markdown help files with PlatyPS
488478
task CreateMarkdownHelp GetPublicFunctions, {
@@ -558,11 +548,6 @@ task CreateUpdateableHelpCAB {
558548
$null = New-ExternalHelpCab -CabFilesFolder "$($StageReleasePath)\en-US\" -LandingPagePath $LandingPage -OutputFolder "$($StageReleasePath)\en-US\" @PlatyPSVerbose
559549
}
560550

561-
# Synopsis: Build help files for module and ignore missing section errors
562-
task TestCreateHelp Configure, CreateMarkdownHelp, CreateExternalHelp, CreateUpdateableHelpCAB, {
563-
Write-Description White 'Create help files' -accent
564-
}
565-
566551
# Synopsis: Create a new version release directory for our release and copy our contents to it
567552
task PushVersionRelease {
568553
Write-Description White "Attempting to push a version release of the module" -accent
@@ -709,9 +694,6 @@ task CreateReadTheDocsYML -if {$Script:BuildEnv.OptionGenerateReadTheDocs} Confi
709694
}
710695
}
711696

712-
# Synopsis: Put together all the various projecet help files
713-
task CreateProjectHelp BuildProjectHelpFiles, AddAdditionalDocFiles, UpdateReadTheDocs, CreateReadTheDocsYML
714-
715697
# Synopsis: Push the current release of the project to PSScriptGallery
716698
task PublishPSGallery LoadBuildTools, InstallModule, {
717699
Write-Description White 'Publishing recent module release to the PowerShell Gallery' -accent
@@ -871,6 +853,26 @@ task GithubPush VersionCheck, {
871853
assert (-not $changes) "Please, commit changes."
872854
}
873855

856+
#Synopsis: Validate script requirements are met, load required modules, load project manifest and module, and load additional build tools.
857+
task Configure ValidateRequirements, PreBuildTasks, LoadRequiredModules, LoadModuleManifest, LoadModule, VersionCheck, LoadBuildTools, {
858+
# If we made it this far then we are configured!
859+
Write-Description White 'Configuring build environment' -accent
860+
}
861+
862+
# Synopsis: Build help files for module and ignore missing section errors
863+
task TestCreateHelp Configure, CreateMarkdownHelp, CreateExternalHelp, CreateUpdateableHelpCAB, {
864+
Write-Description White 'Create help files' -accent
865+
}
866+
867+
# Synopsis: Update the current working module version and release notes
868+
task UpdateVersion NewVersion, UpdateRelease
869+
870+
# Synopsis: Put together all the various projecet help files
871+
task CreateProjectHelp BuildProjectHelpFiles, AddAdditionalDocFiles, UpdateReadTheDocs, CreateReadTheDocsYML
872+
873+
# Synopsis: Build help files for module
874+
task CreateHelp CreateMarkdownHelp, CreateExternalHelp, CreateUpdateableHelpCAB, CreateProjectHelp, AddAdditionalDocFiles
875+
874876
# Synopsis: Build the module
875877
task . Configure, CodeHealthReport, Clean, PrepareStage, GetPublicFunctions, SanitizeCode, CreateHelp, CreateModulePSM1, CreateModuleManifest, AnalyzeModuleRelease, PushVersionRelease, PushCurrentRelease, CreateProjectHelp, PostBuildTasks, BuildSessionCleanup
876878

@@ -884,4 +886,4 @@ task BuildInstallAndTestModule Configure, CodeHealthReport, Clean, PrepareStage,
884886
task BuildInstallTestAndPublishModule Configure, CodeHealthReport, Clean, PrepareStage, GetPublicFunctions, SanitizeCode, CreateHelp, CreateModulePSM1, CreateModuleManifest, AnalyzeModuleRelease, PushVersionRelease, PushCurrentRelease, CreateProjectHelp, InstallModule, TestInstalledModule, PublishPSGallery, PostBuildTasks, BuildSessionCleanup
885887

886888
# Synopsis: Instert Comment Based Help where it doesn't already exist (output to scratch directory)
887-
task InsertMissingCBH Configure, Clean, UpdateCBHtoScratch, BuildSessionCleanup
889+
task AddMissingCBH Configure, Clean, UpdateCBHtoScratch, BuildSessionCleanup

build/docs/Additional/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
1919
- Fixed improper spelling of 'license' in license creation templating.
2020

2121
## Version 0.1.10
22-
- Fixed the -InsertCBH build task.
22+
- Fixed the -AddCBH build task.
2323
- Fixed the missing documentation platyps output to show the actual found line that indicates missing CBH.
2424

2525
## Version 0.1.9

build/docs/Additional/Contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ All base project documentation changes should be made against the .\build\docs\A
1010
Finally, the Function documentation gets generated automatically based on the comment based help on each public/exported function. The function documentation markdown automatically gets populated within the .\docs\Functions folder as well as with the module release under its own docs folder. Private function CBH is not required but is encouraged.
1111

1212
## Development Environment
13-
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. I used VS Code Insiders edition but standard edition should be fine as ewll. The following tasks have been defined to make things a bit easier. First access the 'Pallette' (Shift+Ctrl+P or Shift+Cmd+P) and start typing in any of the following tasks to find and run them:
13+
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. I used VS Code Insiders edition but standard edition should be fine as well. The following tasks have been defined to make things a bit easier. First access the 'Pallette' (Shift+Ctrl+P or Shift+Cmd+P) and start typing in any of the following tasks to find and run them:
1414

1515
- Build -> Runs the Build task (also can use Shift+Ctrl+B or Shift+Cmd+B)
1616
- Analyze -> Runs PSScriptAnalyzer against the src/public files.
1717
- CreateProjectHelp - Creates the project level help.
18-
- InsertMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
18+
- AddMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
1919

2020
The plaster manifest file gets automatically recreated at build time so all you need to do is update the plasterparams.ps1 and/or plastercontent.ps1 in the plaster directory to include any required changes you need to make.
2121

docs/Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ While any text editor will work well there are included task and setting json fi
1515
- Build -> Runs the Build task (also can use Shift+Ctrl+B or Shift+Cmd+B)
1616
- Analyze -> Runs PSScriptAnalyzer against the src/public files.
1717
- CreateProjectHelp - Creates the project level help.
18-
- InsertMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
18+
- AddMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
1919

2020
The plaster manifest file gets automatically recreated at build time so all you need to do is update the plasterparams.ps1 and/or plastercontent.ps1 in the plaster directory to include any required changes you need to make.
2121

plaster/ModuleBuild/scaffold/Build.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param (
1212
[parameter(Position = 5, ParameterSetName = 'Build')]
1313
[string]$ReleaseNotes,
1414
[parameter(Position = 6, ParameterSetName = 'CBH')]
15-
[switch]$InsertCBH
15+
[switch]$AddCBH
1616
)
1717

1818
function PrerequisitesLoaded {
@@ -53,9 +53,9 @@ if (-not (PrerequisitesLoaded)) {
5353

5454
switch ($psCmdlet.ParameterSetName) {
5555
'CBH' {
56-
if ($InsertCBH) {
56+
if ($AddCBH) {
5757
try {
58-
Invoke-Build -Task InsertMissingCBH
58+
Invoke-Build -Task AddMissingCBH
5959
}
6060
catch {
6161
throw

plaster/ModuleBuild/scaffold/build/docs/Additional/Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ While any text editor will work well there are included task and setting json fi
1717
- Analyze -> Runs PSScriptAnalyzer against the src/public files.
1818
- CreateProjectHelp - Creates the project level help.
1919
- Test - Runs Pester tests.
20-
- InsertMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
20+
- AddMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.

plaster/ModuleBuild/scaffold/modulename.build.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,4 +887,4 @@ task BuildInstallAndTestModule Configure, CodeHealthReport, Clean, PrepareStage,
887887
task BuildInstallTestAndPublishModule Configure, CodeHealthReport, Clean, PrepareStage, GetPublicFunctions, SanitizeCode, CreateHelp, CreateModulePSM1, CreateModuleManifest, AnalyzeModuleRelease, PushVersionRelease, PushCurrentRelease, CreateProjectHelp, InstallModule, TestInstalledModule, PublishPSGallery, PostBuildTasks, BuildSessionCleanup
888888

889889
# Synopsis: Instert Comment Based Help where it doesn't already exist (output to scratch directory)
890-
task InsertMissingCBH Configure, Clean, UpdateCBHtoScratch, BuildSessionCleanup
890+
task AddMissingCBH Configure, Clean, UpdateCBHtoScratch, BuildSessionCleanup

plaster/ModuleBuild/scaffold/vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878
"label": "Insert Missing Comment Based Help",
7979
"type": "shell",
8080
"windows": {
81-
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
81+
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
8282
},
8383
"linux": {
84-
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
84+
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
8585
},
8686
"osx": {
87-
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -InsertMissingCBH"
87+
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -AddMissingCBH"
8888
},
8989
"group": {
9090
"kind": "build",

0 commit comments

Comments
 (0)