Include Newtonsoft.Json dependency in the module

This commit is contained in:
Alphaeus Mote
2025-04-28 20:16:01 -04:00
parent 1a75ff9aa7
commit 771c399d45
4 changed files with 21 additions and 3 deletions
+1
View File
@@ -29,6 +29,7 @@ if (-not (Test-Path -Path "$modulePath\bin")) {
# Copy the module files
Copy-Item -Path "$rootPath\Module\PSProxmox.psd1" -Destination $modulePath -Force
Copy-Item -Path "$rootPath\Module\bin\PSProxmox.dll" -Destination "$modulePath\bin" -Force
Copy-Item -Path "$rootPath\Module\bin\Newtonsoft.Json.dll" -Destination "$modulePath\bin" -Force
Copy-Item -Path "$rootPath\LICENSE" -Destination $modulePath -Force
Copy-Item -Path "$rootPath\README.md" -Destination $modulePath -Force
+10
View File
@@ -43,10 +43,20 @@ Copy-Item -Path "$rootPath\LICENSE" -Destination $releaseVersionDir -Force
Copy-Item -Path "$rootPath\README.md" -Destination $releaseVersionDir -Force
Copy-Item -Path "$scriptRoot\Install-PSProxmox.ps1" -Destination $releaseVersionDir -Force
# Make sure the bin directory exists in the release directory
if (-not (Test-Path -Path "$releaseVersionDir\bin")) {
New-Item -Path "$releaseVersionDir\bin" -ItemType Directory -Force | Out-Null
Write-Host "Created bin directory in release: $releaseVersionDir\bin"
}
# 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 "$rootPath\Module\bin" -Force
# Copy dependencies to the Module directory
Write-Host "Copying dependencies to Module directory..."
Copy-Item -Path "$releaseBinDir\Newtonsoft.Json.dll" -Destination "$rootPath\Module\bin" -Force
# Create a ZIP file of the release
$zipPath = "$releaseBaseDir\PSProxmox-$version.zip"
Compress-Archive -Path "$releaseVersionDir\*" -DestinationPath $zipPath -Force