Skip to content

Commit 89fb1ea

Browse files
authored
Fix tasks skipping if PlatyPS is not available (#150)
1 parent 9fee86b commit 89fb1ea

3 files changed

+13
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
### Fixed
9+
10+
- `Generate_Markdown_For_Public_Commands.build`
11+
- Now the task will skip if PlatyPS is not available.
12+
`Generate_External_Help_File_For_Public_Commands`
13+
- Now the task will skip if PlatyPS is not available.
14+
815
## [0.12.3] - 2024-06-01
916

1017
### Fixed

source/tasks/Generate_External_Help_File_For_Public_Commands.build.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ param
8484
Task Generate_External_Help_File_For_Public_Commands {
8585
if (-not (Get-Module -Name 'PlatyPS' -ListAvailable))
8686
{
87-
throw 'PlatyPS is not installed. Please make sure it is available in a path that is listed in $PSModulePath. It can be added to the configuration file RequiredModules.psd1 in the project.'
87+
Write-Warning -Message 'PlatyPS is not installed. Skipping. If public command documentation should be created please make sure PlatyPS is available in a path that is listed in $PSModulePath. It can be added to the configuration file RequiredModules.psd1 in the project.'
88+
89+
return
8890
}
8991

9092
# Get the values for task variables, see https://github.com/gaelcolas/Sampler#task-variables.

source/tasks/Generate_Markdown_For_Public_Commands.build.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ param
123123
Task Generate_Markdown_For_Public_Commands {
124124
if (-not (Get-Module -Name 'PlatyPS' -ListAvailable))
125125
{
126-
throw 'PlatyPS is not installed. Please make sure it is available in a path that is listed in $PSModulePath. It can be added to the configuration file RequiredModules.psd1 in the project.'
126+
Write-Warning -Message 'PlatyPS is not installed. Skipping. If public command documentation should be created please make sure PlatyPS is available in a path that is listed in $PSModulePath. It can be added to the configuration file RequiredModules.psd1 in the project.'
127+
128+
return
127129
}
128130

129131
# Get the values for task variables, see https://github.com/gaelcolas/Sampler#task-variables.

0 commit comments

Comments
 (0)