OCram85/DroneHelper
OCram85
/
DroneHelper
Archived
1
0
Fork 0
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.
DroneHelper/src/Deploy/Invoke-Publish.ps1

47 lines
1.2 KiB
PowerShell

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 = @{
Repository = 'Nexus'
Path = $Repo.Bin.ExpandPath
NuGetApiKey = $Env:NexusToken
Verbose = $VerbosePreference
ErrorAction = 'Stop'
}
Publish-Module @PublishParams
}
}