Skip to content

Commit a6f47cd

Browse files
🩹 [Patch]: Use Microsoft.PowerShell.PlatyPS instead of platyPS (#22)
## Description - Use `Microsoft.PowerShell.PlatyPS` instead of `platyPS` - Needed by https://github.com/PSModule/Build-PSModule/issues/63 ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent ee0fe22 commit a6f47cd

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

scripts/main.ps1

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22

33
[CmdletBinding()]
44
param()
5+
$requiredModules = @{
6+
Utilities = @{}
7+
'powershell-yaml' = @{}
8+
PSSemVer = @{}
9+
Pester = @{}
10+
PSScriptAnalyzer = @{}
11+
# PlatyPS = @{}
12+
'Microsoft.PowerShell.PlatyPS' = @{
13+
Prerelease = $true
14+
}
15+
}
516

6-
$requiredModules = 'Utilities', 'powershell-yaml', 'PSSemVer', 'Pester', 'PSScriptAnalyzer', 'platyPS'
7-
8-
$requiredModules | Sort-Object | ForEach-Object {
9-
$moduleName = $_
10-
LogGroup "Installing prerequisite: [$moduleName]" {
11-
Install-PSResource -Name $moduleName -TrustRepository -Repository PSGallery
12-
Write-Verbose (Get-PSResource -Name $moduleName | Select-Object * | Out-String)
17+
$requiredModules.GetEnumerator() | Sort-Object | ForEach-Object {
18+
$name = $_.Key
19+
$settings = $_.Value
20+
LogGroup "Installing prerequisite: [$name]" {
21+
Install-PSResource -Name $name -TrustRepository -Repository PSGallery @settings
22+
Write-Verbose (Get-PSResource -Name $name | Select-Object * | Out-String)
23+
Write-Verbose (Get-Command -Module $name | Out-String)
1324
}
1425
}
1526

16-
Get-PSResource -Name $requiredModules -Verbose:$false | Sort-Object -Property Name |
27+
$requiredModules.Keys | Get-InstalledPSResource -Verbose:$false | Sort-Object -Property Name |
1728
Format-Table -Property Name, Version, Prerelease, Repository -AutoSize -Wrap

0 commit comments

Comments
 (0)