Skip to content

Commit 54c4bf7

Browse files
bergmeisterJamesWTruher
authored andcommitted
Upgrade platyPS from Version 0.5 to 0.9 (#869)
* Upgrade to platyPS Version 0.9 * improve check, error message and spelling in build tools (and a PSSA warning about incorrect comparison with $null * fix wrong version number
1 parent d432e00 commit 54c4bf7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ task buildDocs -Inputs $bdInputs -Outputs $bdOutputs {
202202
Copy-Item -Path $docsPath\about_PSScriptAnalyzer.help.txt -Destination $outputDocsPath -Force
203203

204204
# Build documentation using platyPS
205-
if ((Get-Module PlatyPS -ListAvailable) -eq $null) {
206-
throw "Cannot find PlatyPS. Please install it from https://www.powershellgallery.com."
205+
if ($null -eq (Get-Module platyPS -ListAvailable -Verbose:$verbosity | Where-Object { $_.Version -ge 0.9 })) {
206+
throw "Cannot find platyPS of version greater or equal to 0.9. Please install it from https://www.powershellgallery.com/packages/platyPS/ using e.g. the following command: Install-Module platyPS"
207207
}
208-
Import-Module PlatyPS
208+
Import-Module platyPS
209209
if (-not (Test-Path $markdownDocsPath -Verbose:$verbosity)) {
210210
throw "Cannot find markdown documentation folder."
211211
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Exit
8282
### From Source
8383

8484
* [.NET Core 2.1.4 SDK](https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.5-download.md)
85-
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
85+
* [PlatyPS 0.9.0 or greater](https://github.com/PowerShell/platyPS/releases)
8686
* Optionally but recommended for development: [Visual Studio 2017](https://www.visualstudio.com/downloads/)
8787

8888
#### Steps

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cache:
1717

1818
# Install Pester
1919
install:
20-
- ps: nuget install platyPS -Version 0.5.0 -source https://www.powershellgallery.com/api/v2 -outputDirectory "$Env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion
20+
- ps: nuget install platyPS -Version 0.9.0 -source https://www.powershellgallery.com/api/v2 -outputDirectory "$Env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion
2121
- ps: |
2222
$requiredPesterVersion = '3.4.0'
2323
$pester = Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }

build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ if ($BuildDocs)
9595
Copy-Item -Path $docsPath\about_PSScriptAnalyzer.help.txt -Destination $outputDocsPath -Force -Verbose:$verbosity
9696

9797
# Build documentation using platyPS
98-
if ((Get-Module PlatyPS -ListAvailable -Verbose:$verbosity) -eq $null)
98+
if ($null -eq (Get-Module platyPS -ListAvailable -Verbose:$verbosity | Where-Object { $_.Version -ge 0.5 }))
9999
{
100-
throw "Cannot find PlatyPS. Please install it from https://www.powershellgallery.com."
100+
"Cannot find platyPS. Please install it from https://www.powershellgallery.com/packages/platyPS/ using e.g. the following command: Install-Module platyPS"
101101
}
102-
if ((Get-Module PlatyPS -Verbose:$verbosity) -eq $null)
102+
if ((Get-Module platyPS -Verbose:$verbosity) -eq $null)
103103
{
104-
Import-Module PlatyPS -Verbose:$verbosity
104+
Import-Module platyPS -Verbose:$verbosity
105105
}
106106
if (-not (Test-Path $markdownDocsPath -Verbose:$verbosity))
107107
{

0 commit comments

Comments
 (0)