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
+3 -2
View File
@@ -1,6 +1,6 @@
@{
RootModule = 'PSProxmox.dll'
ModuleVersion = '2025.04.28.1958'
ModuleVersion = '2025.04.28.2015'
GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad'
Author = 'PSProxmox Team'
CompanyName = 'PSProxmox'
@@ -10,7 +10,7 @@
DotNetFrameworkVersion = '4.7.2'
CompatiblePSEditions = @('Desktop', 'Core')
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @('bin\PSProxmox.dll')
RequiredAssemblies = @('bin\PSProxmox.dll', 'bin\Newtonsoft.Json.dll')
# Script files (.ps1) that are run in the caller's environment prior to importing this module
ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
@@ -91,3 +91,4 @@
+7 -1
View File
@@ -17,7 +17,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
</ItemGroup>
@@ -95,4 +97,8 @@
<None Include="..\Module\PSProxmox.psd1" CopyToOutputDirectory="Always" />
</ItemGroup>
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
</Project>
+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