This repository has been archived on 2023-10-10. You can view files and clone it, but cannot push or open issues or pull requests.
2022-07-13 13:59:25 +02:00
|
|
|
function Invoke-Publish {
|
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
|
|
Publishes powershell module to internal Nexus repository.
|
|
|
|
|
|
|
|
.DESCRIPTION
|
|
|
|
This Cmdlet is used to publish the module via Drone pipeline.
|
|
|
|
|
|
|
|
.INPUTS
|
|
|
|
[None] No pipeline input.
|
|
|
|
|
|
|
|
.OUTPUTS
|
|
|
|
[None] No pipeline output.
|
|
|
|
|
|
|
|
.EXAMPLE
|
|
|
|
Invoke-Publish
|
|
|
|
#>
|
|
|
|
[CmdletBinding()]
|
|
|
|
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
|
|
|
|
'PSUseConsistentWhitespace',
|
|
|
|
'',
|
|
|
|
Justification = 'Hashtable bug in ScriptAnalyzer 1.19.1'
|
|
|
|
)]
|
|
|
|
param ()
|
|
|
|
|
|
|
|
process {
|
|
|
|
$Repo = Get-RepoPath
|
|
|
|
$ExpandParams = @{
|
|
|
|
Path = $Repo.Bin.ArtifactPath
|
|
|
|
DestinationPath = $Repo.Bin.ExpandPath
|
|
|
|
Force = $true
|
|
|
|
ErrorAction = 'Stop'
|
|
|
|
Verbose = $VerbosePreference
|
|
|
|
}
|
|
|
|
Expand-Archive @ExpandParams
|
|
|
|
|
|
|
|
$PublishParams = @{
|
2022-07-13 16:19:33 +02:00
|
|
|
Repository = 'PSGallery'
|
2022-07-13 13:59:25 +02:00
|
|
|
Path = $Repo.Bin.ExpandPath
|
2022-07-13 16:19:33 +02:00
|
|
|
NuGetApiKey = $Env:NuGetToken
|
2022-07-13 13:59:25 +02:00
|
|
|
Verbose = $VerbosePreference
|
|
|
|
ErrorAction = 'Stop'
|
|
|
|
}
|
|
|
|
Publish-Module @PublishParams
|
|
|
|
}
|
|
|
|
}
|