From c2397d3f052a9492b7eb0764b64b22fc0564e65c Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Mon, 28 Apr 2025 19:38:38 -0400 Subject: [PATCH] Reorganize project structure and update build process --- {docs => Documentation}/CHANGELOG.md | 0 {docs => Documentation}/README.md | 0 .../cmdlets/Connect-ProxmoxServer.md | 0 .../cmdlets/Get-ProxmoxVM.md | 0 .../cmdlets/New-ProxmoxVM.md | 0 .../cmdlets/New-ProxmoxVMFromTemplate.md | 0 {docs => Documentation}/cmdlets/README.md | 0 .../Advanced-MultipleVMsFromTemplate.ps1 | 0 .../examples/Advanced-VMBuilder.ps1 | 0 .../examples/Basic-Connection.ps1 | 0 .../examples/Basic-CreateVM.ps1 | 0 .../examples/Cluster-CreateBackup.ps1 | 0 {docs => Documentation}/examples/README.md | 0 .../guides/Cluster-Backup-Restore.md | 0 .../guides/Creating-VMs.md | 0 .../guides/Installation.md | 0 {docs => Documentation}/guides/README.md | 0 Module/PSProxmox.psd1 | 3 +- PSProxmox/PSProxmox.Main.csproj | 4 -- README.md | 4 ++ build.ps1 | 48 ++++++++++--------- 21 files changed, 32 insertions(+), 27 deletions(-) rename {docs => Documentation}/CHANGELOG.md (100%) rename {docs => Documentation}/README.md (100%) rename {docs => Documentation}/cmdlets/Connect-ProxmoxServer.md (100%) rename {docs => Documentation}/cmdlets/Get-ProxmoxVM.md (100%) rename {docs => Documentation}/cmdlets/New-ProxmoxVM.md (100%) rename {docs => Documentation}/cmdlets/New-ProxmoxVMFromTemplate.md (100%) rename {docs => Documentation}/cmdlets/README.md (100%) rename {docs => Documentation}/examples/Advanced-MultipleVMsFromTemplate.ps1 (100%) rename {docs => Documentation}/examples/Advanced-VMBuilder.ps1 (100%) rename {docs => Documentation}/examples/Basic-Connection.ps1 (100%) rename {docs => Documentation}/examples/Basic-CreateVM.ps1 (100%) rename {docs => Documentation}/examples/Cluster-CreateBackup.ps1 (100%) rename {docs => Documentation}/examples/README.md (100%) rename {docs => Documentation}/guides/Cluster-Backup-Restore.md (100%) rename {docs => Documentation}/guides/Creating-VMs.md (100%) rename {docs => Documentation}/guides/Installation.md (100%) rename {docs => Documentation}/guides/README.md (100%) diff --git a/docs/CHANGELOG.md b/Documentation/CHANGELOG.md similarity index 100% rename from docs/CHANGELOG.md rename to Documentation/CHANGELOG.md diff --git a/docs/README.md b/Documentation/README.md similarity index 100% rename from docs/README.md rename to Documentation/README.md diff --git a/docs/cmdlets/Connect-ProxmoxServer.md b/Documentation/cmdlets/Connect-ProxmoxServer.md similarity index 100% rename from docs/cmdlets/Connect-ProxmoxServer.md rename to Documentation/cmdlets/Connect-ProxmoxServer.md diff --git a/docs/cmdlets/Get-ProxmoxVM.md b/Documentation/cmdlets/Get-ProxmoxVM.md similarity index 100% rename from docs/cmdlets/Get-ProxmoxVM.md rename to Documentation/cmdlets/Get-ProxmoxVM.md diff --git a/docs/cmdlets/New-ProxmoxVM.md b/Documentation/cmdlets/New-ProxmoxVM.md similarity index 100% rename from docs/cmdlets/New-ProxmoxVM.md rename to Documentation/cmdlets/New-ProxmoxVM.md diff --git a/docs/cmdlets/New-ProxmoxVMFromTemplate.md b/Documentation/cmdlets/New-ProxmoxVMFromTemplate.md similarity index 100% rename from docs/cmdlets/New-ProxmoxVMFromTemplate.md rename to Documentation/cmdlets/New-ProxmoxVMFromTemplate.md diff --git a/docs/cmdlets/README.md b/Documentation/cmdlets/README.md similarity index 100% rename from docs/cmdlets/README.md rename to Documentation/cmdlets/README.md diff --git a/docs/examples/Advanced-MultipleVMsFromTemplate.ps1 b/Documentation/examples/Advanced-MultipleVMsFromTemplate.ps1 similarity index 100% rename from docs/examples/Advanced-MultipleVMsFromTemplate.ps1 rename to Documentation/examples/Advanced-MultipleVMsFromTemplate.ps1 diff --git a/docs/examples/Advanced-VMBuilder.ps1 b/Documentation/examples/Advanced-VMBuilder.ps1 similarity index 100% rename from docs/examples/Advanced-VMBuilder.ps1 rename to Documentation/examples/Advanced-VMBuilder.ps1 diff --git a/docs/examples/Basic-Connection.ps1 b/Documentation/examples/Basic-Connection.ps1 similarity index 100% rename from docs/examples/Basic-Connection.ps1 rename to Documentation/examples/Basic-Connection.ps1 diff --git a/docs/examples/Basic-CreateVM.ps1 b/Documentation/examples/Basic-CreateVM.ps1 similarity index 100% rename from docs/examples/Basic-CreateVM.ps1 rename to Documentation/examples/Basic-CreateVM.ps1 diff --git a/docs/examples/Cluster-CreateBackup.ps1 b/Documentation/examples/Cluster-CreateBackup.ps1 similarity index 100% rename from docs/examples/Cluster-CreateBackup.ps1 rename to Documentation/examples/Cluster-CreateBackup.ps1 diff --git a/docs/examples/README.md b/Documentation/examples/README.md similarity index 100% rename from docs/examples/README.md rename to Documentation/examples/README.md diff --git a/docs/guides/Cluster-Backup-Restore.md b/Documentation/guides/Cluster-Backup-Restore.md similarity index 100% rename from docs/guides/Cluster-Backup-Restore.md rename to Documentation/guides/Cluster-Backup-Restore.md diff --git a/docs/guides/Creating-VMs.md b/Documentation/guides/Creating-VMs.md similarity index 100% rename from docs/guides/Creating-VMs.md rename to Documentation/guides/Creating-VMs.md diff --git a/docs/guides/Installation.md b/Documentation/guides/Installation.md similarity index 100% rename from docs/guides/Installation.md rename to Documentation/guides/Installation.md diff --git a/docs/guides/README.md b/Documentation/guides/README.md similarity index 100% rename from docs/guides/README.md rename to Documentation/guides/README.md diff --git a/Module/PSProxmox.psd1 b/Module/PSProxmox.psd1 index 64f293f..9483301 100644 --- a/Module/PSProxmox.psd1 +++ b/Module/PSProxmox.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'PSProxmox.dll' - ModuleVersion = '2025.04.28.1934' + ModuleVersion = '2025.04.28.1937' GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad' Author = 'PSProxmox Team' CompanyName = 'PSProxmox' @@ -88,3 +88,4 @@ } } + diff --git a/PSProxmox/PSProxmox.Main.csproj b/PSProxmox/PSProxmox.Main.csproj index 0cc1865..769815b 100644 --- a/PSProxmox/PSProxmox.Main.csproj +++ b/PSProxmox/PSProxmox.Main.csproj @@ -95,8 +95,4 @@ - - - - diff --git a/README.md b/README.md index f72c555..fdabdad 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,10 @@ Clear-ProxmoxIPPool -Name "Production" Disconnect-ProxmoxServer -Connection $connection ``` +## Documentation + +For detailed documentation, see the [Documentation](Documentation) directory. + ## License This project is licensed under the MIT License - see the LICENSE file for details. diff --git a/build.ps1 b/build.ps1 index 18cf184..afea693 100644 --- a/build.ps1 +++ b/build.ps1 @@ -11,37 +11,41 @@ $psd1Content = Get-Content -Path $psd1Path -Raw $psd1Content = $psd1Content -replace "ModuleVersion = '.*'", "ModuleVersion = '$version'" Set-Content -Path $psd1Path -Value $psd1Content -# Build the solution -Write-Host "Building solution..." -dotnet build .\PSProxmox\PSProxmox.Main.csproj -c Release +# Create the release directory structure +$releaseBaseDir = ".\Release" +$releaseVersionDir = "$releaseBaseDir\$version" +$releaseBinDir = "$releaseVersionDir\bin" -# Create the release directory -$releaseDir = ".\Release\$version" -if (-not (Test-Path -Path $releaseDir)) { - New-Item -Path $releaseDir -ItemType Directory -Force | Out-Null - Write-Host "Created release directory: $releaseDir" +# Create directories if they don't exist +if (-not (Test-Path -Path $releaseBaseDir)) { + New-Item -Path $releaseBaseDir -ItemType Directory -Force | Out-Null +} +if (-not (Test-Path -Path $releaseVersionDir)) { + New-Item -Path $releaseVersionDir -ItemType Directory -Force | Out-Null + Write-Host "Created release directory: $releaseVersionDir" } - -# Copy the module files to the release directory -Copy-Item -Path .\Module\PSProxmox.psd1 -Destination $releaseDir -Force -Copy-Item -Path .\Module\bin\PSProxmox.dll -Destination $releaseDir -Force -Copy-Item -Path .\Module\LICENSE -Destination $releaseDir -Force -Copy-Item -Path .\Module\README.md -Destination $releaseDir -Force -Copy-Item -Path .\Module\Install-PSProxmox.ps1 -Destination $releaseDir -Force - -# Create a bin directory in the release directory -$releaseBinDir = "$releaseDir\bin" if (-not (Test-Path -Path $releaseBinDir)) { New-Item -Path $releaseBinDir -ItemType Directory -Force | Out-Null Write-Host "Created bin directory: $releaseBinDir" } -# Copy the DLL to the bin directory -Copy-Item -Path .\Module\bin\PSProxmox.dll -Destination $releaseBinDir -Force +# Build the solution directly to the release bin directory +Write-Host "Building solution..." +dotnet build .\PSProxmox\PSProxmox.Main.csproj -c Release -o $releaseBinDir + +# Copy the module files to the release directory +Copy-Item -Path .\Module\PSProxmox.psd1 -Destination $releaseVersionDir -Force +Copy-Item -Path .\LICENSE -Destination $releaseVersionDir -Force +Copy-Item -Path .\README.md -Destination $releaseVersionDir -Force +Copy-Item -Path .\Module\Install-PSProxmox.ps1 -Destination $releaseVersionDir -Force + +# Copy the fully prepared module back to the Module directory +Write-Host "Updating Module directory with built files..." +Copy-Item -Path $releaseBinDir\PSProxmox.dll -Destination .\Module\bin -Force # Create a ZIP file of the release -$zipPath = ".\Release\PSProxmox-$version.zip" -Compress-Archive -Path $releaseDir\* -DestinationPath $zipPath -Force +$zipPath = "$releaseBaseDir\PSProxmox-$version.zip" +Compress-Archive -Path $releaseVersionDir\* -DestinationPath $zipPath -Force Write-Host "Created release package: $zipPath" Write-Host "Build completed successfully!"