Build-Publish-Module.ps1

Param(
    $Path=$null,
    $ApiKey=$null
)

Write-Host "Starting Script ""Build-Sign-Scripts.ps1""" -ForegroundColor Gray -BackgroundColor White

if($ApiKey -eq $null) { throw "API Key not given" }

Write-Host "Try to set SourceDir from Build-variable"
$SourceDir=$Path
 
if([String]::IsNullOrEmpty($SourceDir)) {
    $SourceDir=$($PSScriptRoot)
    Write-Host "Build-variable was not given. Using PSScriptRoot"
}

Publish-Module -Path $SourceDir -NuGetApiKey $ApiKey