mirror of
https://github.com/Grace-Solutions/PSProxmox.git
synced 2026-08-19 02:56:18 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user