feat: Add -IncludeGuestAgent parameter for performance optimization

- Added optional -IncludeGuestAgent parameter to Get-ProxmoxVM cmdlet
- Guest agent data retrieval is now optional for improved query performance
- Default behavior: Fast queries without guest agent data
- Use -IncludeGuestAgent switch when detailed network information is needed
- Significant performance improvement for normal VM queries
- Updated all documentation and examples to use new parameter
- Fixed binary module structure by removing unnecessary PSD1 from bin folder
- Version bump to 2025.05.30.2323

BREAKING CHANGE: Get-ProxmoxVM no longer fetches guest agent data by default.
Existing scripts that rely on guest agent data must add -IncludeGuestAgent parameter.
This commit is contained in:
AX-AMote
2025-05-30 23:25:19 -04:00
parent 33898b7b80
commit d9bd620168
10 changed files with 174 additions and 57 deletions
+7 -3
View File
@@ -101,8 +101,8 @@ Remove-ProxmoxVM -Node "pve1" -VMID 100 -Confirm:$false
### Working with VM Guest Agent
```powershell
# Get VM with guest agent information
$vm = Get-ProxmoxVM -VMID 100
# Get VM with guest agent information (use -IncludeGuestAgent for detailed network info)
$vm = Get-ProxmoxVM -VMID 100 -IncludeGuestAgent
# Check if guest agent is available and running
if ($vm.GuestAgent -and $vm.GuestAgent.Status -eq "running") {
@@ -120,10 +120,14 @@ if ($vm.GuestAgent -and $vm.GuestAgent.Status -eq "running") {
}
# Get all VMs with active guest agents
$vmsWithGuestAgent = Get-ProxmoxVM | Where-Object {
$vmsWithGuestAgent = Get-ProxmoxVM -IncludeGuestAgent | Where-Object {
$_.GuestAgent -and $_.GuestAgent.Status -eq "running"
}
# Performance comparison: fast vs detailed queries
Measure-Command { $fastVMs = Get-ProxmoxVM } # Fast query
Measure-Command { $detailedVMs = Get-ProxmoxVM -IncludeGuestAgent } # Detailed query
# Find VMs by IP address using guest agent data
$searchIP = "192.168.1.100"
$foundVMs = $vmsWithGuestAgent | Where-Object {