mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
29 lines
721 B
PowerShell
29 lines
721 B
PowerShell
|
|
# 生成版本信息文件
|
||
|
|
param(
|
||
|
|
[Parameter(Mandatory=$true)]
|
||
|
|
[string]$OutputPath,
|
||
|
|
|
||
|
|
[Parameter(Mandatory=$true)]
|
||
|
|
[string]$Version,
|
||
|
|
|
||
|
|
[Parameter(Mandatory=$false)]
|
||
|
|
[string]$Codename = "Administrate"
|
||
|
|
)
|
||
|
|
|
||
|
|
$versionInfo = @{
|
||
|
|
Version = $Version
|
||
|
|
Codename = $Codename
|
||
|
|
}
|
||
|
|
|
||
|
|
$json = $versionInfo | ConvertTo-Json -Compress
|
||
|
|
$dir = Split-Path -Parent $OutputPath
|
||
|
|
|
||
|
|
if (!(Test-Path $dir)) {
|
||
|
|
New-Item -ItemType Directory -Path $dir -Force | Out-Null
|
||
|
|
}
|
||
|
|
|
||
|
|
Set-Content -Path $OutputPath -Value $json -Encoding UTF8
|
||
|
|
Write-Host "Generated version file: $OutputPath" -ForegroundColor Green
|
||
|
|
Write-Host " Version: $Version" -ForegroundColor Gray
|
||
|
|
Write-Host " Codename: $Codename" -ForegroundColor Gray
|