Skip to content

Upgrade platyPS from Version 0.5 to 0.9 #869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ task buildDocs -Inputs $bdInputs -Outputs $bdOutputs {
Copy-Item -Path $docsPath\about_PSScriptAnalyzer.help.txt -Destination $outputDocsPath -Force

# Build documentation using platyPS
if ((Get-Module PlatyPS -ListAvailable) -eq $null) {
throw "Cannot find PlatyPS. Please install it from https://www.powershellgallery.com."
if ($null -eq (Get-Module platyPS -ListAvailable -Verbose:$verbosity | Where-Object { $_.Version -ge 0.9 })) {
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"
}
Import-Module PlatyPS
Import-Module platyPS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have -minimumversion 0.9.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this is not needed because we already checked on the line above that the user has a module with a version greater or equal to 0.9. Does Import-Module not always import the latest version in some case?
Would it in general be better to require that 0.9.x is exactly installed and not allow newer versions at all? Then we would need to use the -RequiredVersion parameter. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will import the latest version and there's a later test to be sure it meets the requirement. It's probably fine, just wanted to be sure.

if (-not (Test-Path $markdownDocsPath -Verbose:$verbosity)) {
throw "Cannot find markdown documentation folder."
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Exit
### From Source

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

#### Steps
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cache:

# Install Pester
install:
- ps: nuget install platyPS -Version 0.5.0 -source https://www.powershellgallery.com/api/v2 -outputDirectory "$Env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion
- ps: nuget install platyPS -Version 0.9.0 -source https://www.powershellgallery.com/api/v2 -outputDirectory "$Env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion
- ps: |
$requiredPesterVersion = '3.4.0'
$pester = Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
Expand Down
8 changes: 4 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ if ($BuildDocs)
Copy-Item -Path $docsPath\about_PSScriptAnalyzer.help.txt -Destination $outputDocsPath -Force -Verbose:$verbosity

# Build documentation using platyPS
if ((Get-Module PlatyPS -ListAvailable -Verbose:$verbosity) -eq $null)
if ($null -eq (Get-Module platyPS -ListAvailable -Verbose:$verbosity | Where-Object { $_.Version -ge 0.5 }))
{
throw "Cannot find PlatyPS. Please install it from https://www.powershellgallery.com."
"Cannot find platyPS. Please install it from https://www.powershellgallery.com/packages/platyPS/ using e.g. the following command: Install-Module platyPS"
}
if ((Get-Module PlatyPS -Verbose:$verbosity) -eq $null)
if ((Get-Module platyPS -Verbose:$verbosity) -eq $null)
{
Import-Module PlatyPS -Verbose:$verbosity
Import-Module platyPS -Verbose:$verbosity
}
if (-not (Test-Path $markdownDocsPath -Verbose:$verbosity))
{
Expand Down