Skip to content

Use RequiredResource hashtable to specify PowerShell module versions #112

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 1 commit into from
Jan 31, 2025
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
2 changes: 1 addition & 1 deletion SecretStore.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ task Package {
}

task Test {
Invoke-Pester -CI -Output Diagnostic
Invoke-Pester -CI
}

task Build BuildModule, BuildDocs
Expand Down
27 changes: 22 additions & 5 deletions tools/installPSResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,27 @@ param(
)

if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) {
Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json"
Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json"
}

Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS
Install-PSResource -Repository $PSRepository -TrustRepository -Name Pester
Install-PSResource -Repository $PSRepository -TrustRepository -Name Microsoft.PowerShell.SecretManagement
# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to
# request an exact version. Otherwise, if a newer version is available in the
# upstream feed, it will fail to install any version at all.
Install-PSResource -Verbose -TrustRepository -RequiredResource @{
InvokeBuild = @{
version = "5.12.1"
repository = $PSRepository
}
platyPS = @{
version = "0.14.2"
repository = $PSRepository
}
Pester = @{
version = "5.7.1"
repository = $PSRepository
}
"Microsoft.PowerShell.SecretManagement" = @{
version = "1.1.2"
repository = $PSRepository
}
}