publish.ps1

Import-Module DotupPsEssentials
Import-Module DotupPsModuleGenerator

$path = Get-Location;
$moduleName = Split-Path $path -Leaf
$moduleFile = "$((Join-Path $path $moduleName)).psd1"

$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'

$file = Import-PowerShellDataFile $moduleFile;
[version]$version = ($file).ModuleVersion
# Add one to the build of the version number
[version]$newVersion = "{0}.{1}.{2}" -f $version.Major, $version.Minor, ($version.Build + 1) 
($file).ModuleVersion = $newVersion;
# Update the manifest file
Update-ModuleManifest -Path $moduleFile -ModuleVersion $newVersion
#$functions = Get-PsModuleFunctions $path -PublicOnly
#Update-ModuleManifest -Path $moduleFile -FunctionsToExport $functions;

$PowershellApiKey = "oy2brhym6syjwgjiwnoqhnh56zx52pju7b27ravqwewwwy";

Publish-Module -Path $path -NugetAPIKey $PowershellApiKey;