Skip to content

Commit 7558f45

Browse files
committed
Update yaml to use PSResourceGet
1 parent 9bb52af commit 7558f45

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.ci/releaseBuild.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,23 @@ stages:
105105
PackageName: 'PowerShellGet'
106106
PackageVersion: '$(moduleVersion)'
107107

108+
- pwsh: |
109+
Set-PSRepository PSGallery -InstallationPolicy Trusted
110+
Install-Module "Microsoft.PowerShell.PSResourceGet" -Repository PSGallery
111+
Import-Module "Microsoft.PowerShell.PSResourceGet"
112+
displayName: Install and import Microsoft.PowerShell.PSResourceGet
113+
108114
# Register local folder as PSRepository
109-
# Then publish-module to that folder
115+
# Then publish module to that folder
110116
- pwsh: |
111117
$localRepo = "$(Build.SourcesDirectory)/local"
112118
New-Item -Path $localRepo -ItemType Directory -Force
113119
$vstsCommandString = "vso[task.setvariable variable=localRepo]${localRepo}"
114120
Write-Host "local repo is: " + $vstsCommandString
115121
Write-Host "##$vstsCommandString"
116122
117-
Register-PSRepository -Name local -SourceLocation $localRepo
118-
Publish-Module -Path $(signOutPath) -Repository local
123+
Register-PSResourceRepository -Name local -URI $localRepo
124+
Publish-PSResource -Path $(signOutPath) -Repository local
119125
displayName: Publish module to local repository
120126
121127
# finally publish the parts of the build which will be used in the next stages

0 commit comments

Comments
 (0)