Update build scripts to support version parameter

This commit is contained in:
Alphaeus Mote
2025-05-09 15:12:23 -04:00
parent effaf14886
commit 3516dd3acb
3 changed files with 11 additions and 5 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
@{
RootModule = 'PSProxmox.psm1'
NestedModules = @('bin\PSProxmox.dll')
ModuleVersion = '2025.05.09.1504'
ModuleVersion = '2025.05.09.1511'
GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad'
Author = 'PSProxmox Team'
CompanyName = 'PSProxmox'
@@ -107,3 +107,4 @@
+3 -2
View File
@@ -4,13 +4,14 @@
param(
[Parameter(Mandatory = $true)]
[string]$ApiKey,
[Parameter(Mandatory = $false)]
[string]$Version = (Get-Date -Format "yyyy.MM.dd.HHmm")
)
# Ensure the module is built
Write-Host "Building the module..."
Write-Host "Building the module with version $Version..."
$env:MODULE_VERSION = $Version
& "$PSScriptRoot\build-release-only.ps1"
# Get the release directory
+6 -2
View File
@@ -5,8 +5,12 @@
$scriptRoot = $PSScriptRoot
$rootPath = Split-Path -Parent $scriptRoot
# Set the version based on the current date and time
$version = Get-Date -Format "yyyy.MM.dd.HHmm"
# Set the version based on the environment variable or current date and time
if ($env:MODULE_VERSION) {
$version = $env:MODULE_VERSION
} else {
$version = Get-Date -Format "yyyy.MM.dd.HHmm"
}
Write-Host "Building PSProxmox version $version"
# Update the module version in the PSD1 file