1
1
Add-BuildTask PSModulePush {
2
2
if ($BuildSystem -ne ' None' -and
3
3
$BranchName -in " master" , " main" -and
4
- -not [string ]::IsNullOrWhiteSpace($PSModulePublishKey )) {
4
+ -not [string ]::IsNullOrWhiteSpace($PSGalleryKey )) {
5
5
6
- # If the $PSModulePublishUri is set, make sure that's where we publish....
7
- if ($PSModulePublishUri -and $Script :PSRepository ) {
6
+ # If the $PSGalleryUri is set, make sure that's where we publish....
7
+ if ($PSGalleryUri -and $Script :PSRepository ) {
8
8
$PackageSource = Get-PSRepository - Name $Script :PSRepository - ErrorAction Ignore
9
- If (-Not $PackageSource -or $PackageSource.PublishLocation -ne $PSModulePublishUri ) {
9
+ If (-Not $PackageSource -or $PackageSource.PublishLocation -ne $PSGalleryUri ) {
10
10
$source = @ {
11
11
Name = $Script :PSRepository
12
- Location = $PSModulePublishUri
12
+ Location = $PSGalleryUri
13
13
Force = $true
14
14
Trusted = $True
15
15
ForceBootstrap = $True
@@ -20,7 +20,7 @@ Add-BuildTask PSModulePush {
20
20
}
21
21
$publishModuleSplat = @ {
22
22
Path = $PSModuleOutputPath
23
- NuGetApiKey = $PSModulePublishKey
23
+ NuGetApiKey = $PSGalleryKey
24
24
Verbose = $true
25
25
Force = $true
26
26
Repository = $Script :PSRepository
@@ -37,7 +37,7 @@ Add-BuildTask PSModulePush {
37
37
Write-Warning (" Skipping publish: To publish, ensure that...`n " +
38
38
" `t * You are in a known build system (Current: $BuildSystem )`n " +
39
39
" `t * You are committing to the main branch (Current: $BranchName ) `n " +
40
- " `t * The repository APIKey is defined in `$ PSModulePublishKey (Current: $ ( ! [string ]::IsNullOrWhiteSpace($PSModulePublishKey )) )" )
40
+ " `t * The repository APIKey is defined in `$ PSGalleryKey (Current: $ ( ! [string ]::IsNullOrWhiteSpace($PSGalleryKey )) )" )
41
41
}
42
42
}
43
- Add-BuildTask PSModulePublish PSModulePush
43
+ Add-BuildTask PSGallery PSModulePush
0 commit comments