From 7558f456b4ea9c956feffc870ad83f6f6b0f6117 Mon Sep 17 00:00:00 2001 From: alerickson <25858831+alerickson@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:46:44 -0700 Subject: [PATCH 1/2] Update yaml to use PSResourceGet --- .ci/releaseBuild.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.ci/releaseBuild.yml b/.ci/releaseBuild.yml index d6b3ea6..5db9c73 100644 --- a/.ci/releaseBuild.yml +++ b/.ci/releaseBuild.yml @@ -105,8 +105,14 @@ stages: PackageName: 'PowerShellGet' PackageVersion: '$(moduleVersion)' + - pwsh: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module "Microsoft.PowerShell.PSResourceGet" -Repository PSGallery + Import-Module "Microsoft.PowerShell.PSResourceGet" + displayName: Install and import Microsoft.PowerShell.PSResourceGet + # Register local folder as PSRepository - # Then publish-module to that folder + # Then publish module to that folder - pwsh: | $localRepo = "$(Build.SourcesDirectory)/local" New-Item -Path $localRepo -ItemType Directory -Force @@ -114,8 +120,8 @@ stages: Write-Host "local repo is: " + $vstsCommandString Write-Host "##$vstsCommandString" - Register-PSRepository -Name local -SourceLocation $localRepo - Publish-Module -Path $(signOutPath) -Repository local + Register-PSResourceRepository -Name local -URI $localRepo + Publish-PSResource -Path $(signOutPath) -Repository local displayName: Publish module to local repository # finally publish the parts of the build which will be used in the next stages From d421244b1fbe23dcce8d6fa9c3b923cd7a10f599 Mon Sep 17 00:00:00 2001 From: alerickson <25858831+alerickson@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:02:57 -0700 Subject: [PATCH 2/2] Remove unneeded import --- .ci/releaseBuild.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/releaseBuild.yml b/.ci/releaseBuild.yml index 5db9c73..b61f697 100644 --- a/.ci/releaseBuild.yml +++ b/.ci/releaseBuild.yml @@ -108,7 +108,6 @@ stages: - pwsh: | Set-PSRepository PSGallery -InstallationPolicy Trusted Install-Module "Microsoft.PowerShell.PSResourceGet" -Repository PSGallery - Import-Module "Microsoft.PowerShell.PSResourceGet" displayName: Install and import Microsoft.PowerShell.PSResourceGet # Register local folder as PSRepository