mirror of
https://github.com/Grace-Solutions/PSProxmox.git
synced 2026-08-27 15:37:02 +00:00
Move scripts to Scripts folder and update paths
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
@{
|
@{
|
||||||
RootModule = 'PSProxmox.dll'
|
RootModule = 'PSProxmox.dll'
|
||||||
ModuleVersion = '2025.04.28.1937'
|
ModuleVersion = '2025.04.28.1958'
|
||||||
GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad'
|
GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad'
|
||||||
Author = 'PSProxmox Team'
|
Author = 'PSProxmox Team'
|
||||||
CompanyName = 'PSProxmox'
|
CompanyName = 'PSProxmox'
|
||||||
@@ -89,3 +89,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
# Install-PSProxmox.ps1
|
# Install-PSProxmox.ps1
|
||||||
# This script installs the PSProxmox module to the user's PowerShell modules directory
|
# This script installs the PSProxmox module to the user's PowerShell modules directory
|
||||||
|
|
||||||
|
# Set script root path for relative paths
|
||||||
|
$scriptRoot = $PSScriptRoot
|
||||||
|
$rootPath = Split-Path -Parent $scriptRoot
|
||||||
|
|
||||||
# Define the module name
|
# Define the module name
|
||||||
$moduleName = "PSProxmox"
|
$moduleName = "PSProxmox"
|
||||||
|
|
||||||
@@ -23,10 +27,10 @@ if (-not (Test-Path -Path "$modulePath\bin")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Copy the module files
|
# Copy the module files
|
||||||
Copy-Item -Path "$PSScriptRoot\PSProxmox.psd1" -Destination $modulePath -Force
|
Copy-Item -Path "$rootPath\Module\PSProxmox.psd1" -Destination $modulePath -Force
|
||||||
Copy-Item -Path "$PSScriptRoot\bin\PSProxmox.dll" -Destination "$modulePath\bin" -Force
|
Copy-Item -Path "$rootPath\Module\bin\PSProxmox.dll" -Destination "$modulePath\bin" -Force
|
||||||
Copy-Item -Path "$PSScriptRoot\LICENSE" -Destination $modulePath -Force
|
Copy-Item -Path "$rootPath\LICENSE" -Destination $modulePath -Force
|
||||||
Copy-Item -Path "$PSScriptRoot\README.md" -Destination $modulePath -Force
|
Copy-Item -Path "$rootPath\README.md" -Destination $modulePath -Force
|
||||||
|
|
||||||
Write-Host "PSProxmox module has been installed to $modulePath"
|
Write-Host "PSProxmox module has been installed to $modulePath"
|
||||||
Write-Host "You can now import the module using: Import-Module $moduleName"
|
Write-Host "You can now import the module using: Import-Module $moduleName"
|
||||||
@@ -1,18 +1,22 @@
|
|||||||
# build.ps1
|
# build.ps1
|
||||||
# This script builds the PSProxmox module and creates a release package
|
# This script builds the PSProxmox module and creates a release package
|
||||||
|
|
||||||
|
# Set script root path for relative paths
|
||||||
|
$scriptRoot = $PSScriptRoot
|
||||||
|
$rootPath = Split-Path -Parent $scriptRoot
|
||||||
|
|
||||||
# Set the version based on the current date and time
|
# Set the version based on the current date and time
|
||||||
$version = Get-Date -Format "yyyy.MM.dd.HHmm"
|
$version = Get-Date -Format "yyyy.MM.dd.HHmm"
|
||||||
Write-Host "Building PSProxmox version $version"
|
Write-Host "Building PSProxmox version $version"
|
||||||
|
|
||||||
# Update the module version in the PSD1 file
|
# Update the module version in the PSD1 file
|
||||||
$psd1Path = ".\Module\PSProxmox.psd1"
|
$psd1Path = "$rootPath\Module\PSProxmox.psd1"
|
||||||
$psd1Content = Get-Content -Path $psd1Path -Raw
|
$psd1Content = Get-Content -Path $psd1Path -Raw
|
||||||
$psd1Content = $psd1Content -replace "ModuleVersion = '.*'", "ModuleVersion = '$version'"
|
$psd1Content = $psd1Content -replace "ModuleVersion = '.*'", "ModuleVersion = '$version'"
|
||||||
Set-Content -Path $psd1Path -Value $psd1Content
|
Set-Content -Path $psd1Path -Value $psd1Content
|
||||||
|
|
||||||
# Create the release directory structure
|
# Create the release directory structure
|
||||||
$releaseBaseDir = ".\Release"
|
$releaseBaseDir = "$rootPath\Release"
|
||||||
$releaseVersionDir = "$releaseBaseDir\$version"
|
$releaseVersionDir = "$releaseBaseDir\$version"
|
||||||
$releaseBinDir = "$releaseVersionDir\bin"
|
$releaseBinDir = "$releaseVersionDir\bin"
|
||||||
|
|
||||||
@@ -31,21 +35,21 @@ if (-not (Test-Path -Path $releaseBinDir)) {
|
|||||||
|
|
||||||
# Build the solution directly to the release bin directory
|
# Build the solution directly to the release bin directory
|
||||||
Write-Host "Building solution..."
|
Write-Host "Building solution..."
|
||||||
dotnet build .\PSProxmox\PSProxmox.Main.csproj -c Release -o $releaseBinDir
|
dotnet build "$rootPath\PSProxmox\PSProxmox.Main.csproj" -c Release -o $releaseBinDir
|
||||||
|
|
||||||
# Copy the module files to the release directory
|
# Copy the module files to the release directory
|
||||||
Copy-Item -Path .\Module\PSProxmox.psd1 -Destination $releaseVersionDir -Force
|
Copy-Item -Path "$rootPath\Module\PSProxmox.psd1" -Destination $releaseVersionDir -Force
|
||||||
Copy-Item -Path .\LICENSE -Destination $releaseVersionDir -Force
|
Copy-Item -Path "$rootPath\LICENSE" -Destination $releaseVersionDir -Force
|
||||||
Copy-Item -Path .\README.md -Destination $releaseVersionDir -Force
|
Copy-Item -Path "$rootPath\README.md" -Destination $releaseVersionDir -Force
|
||||||
Copy-Item -Path .\Module\Install-PSProxmox.ps1 -Destination $releaseVersionDir -Force
|
Copy-Item -Path "$scriptRoot\Install-PSProxmox.ps1" -Destination $releaseVersionDir -Force
|
||||||
|
|
||||||
# Copy the fully prepared module back to the Module directory
|
# Copy the fully prepared module back to the Module directory
|
||||||
Write-Host "Updating Module directory with built files..."
|
Write-Host "Updating Module directory with built files..."
|
||||||
Copy-Item -Path $releaseBinDir\PSProxmox.dll -Destination .\Module\bin -Force
|
Copy-Item -Path "$releaseBinDir\PSProxmox.dll" -Destination "$rootPath\Module\bin" -Force
|
||||||
|
|
||||||
# Create a ZIP file of the release
|
# Create a ZIP file of the release
|
||||||
$zipPath = "$releaseBaseDir\PSProxmox-$version.zip"
|
$zipPath = "$releaseBaseDir\PSProxmox-$version.zip"
|
||||||
Compress-Archive -Path $releaseVersionDir\* -DestinationPath $zipPath -Force
|
Compress-Archive -Path "$releaseVersionDir\*" -DestinationPath $zipPath -Force
|
||||||
Write-Host "Created release package: $zipPath"
|
Write-Host "Created release package: $zipPath"
|
||||||
|
|
||||||
Write-Host "Build completed successfully!"
|
Write-Host "Build completed successfully!"
|
||||||
Reference in New Issue
Block a user