better error handling when publishing module (#7131)

This commit is contained in:
William Cheng 2020-08-06 14:05:43 +08:00 committed by GitHub
parent f752f29af2
commit be02a33c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -18,12 +18,10 @@ deploy_script:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") {
.\Build.ps1
choco install NuGet.CommandLine
Install-PackageProvider -Name NuGet -Force
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\{{{packageName}}}\ -Confirm:$False -Verbose
if ($LastExitCode -ne 0) {
$host.SetShouldExit($LastExitCode)
exit $LastExitCode
exit
} else {
Write-Host "Published the PowerShell module."
}

View File

@ -24,12 +24,10 @@ deploy_script:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") {
.\Build.ps1
choco install NuGet.CommandLine
Install-PackageProvider -Name NuGet -Force
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\PSPetstore\ -Confirm:$False -Verbose
if ($LastExitCode -ne 0) {
$host.SetShouldExit($LastExitCode)
exit $LastExitCode
exit
} else {
Write-Host "Published the PowerShell module."
}