Skip to content

Commit

Permalink
Update yaml to use PSResourceGet
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson committed Oct 31, 2023
1 parent 9bb52af commit 7558f45
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .ci/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,23 @@ 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
$vstsCommandString = "vso[task.setvariable variable=localRepo]${localRepo}"
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
Expand Down

0 comments on commit 7558f45

Please sign in to comment.