Files
PSProxmoxVE/src/PSProxmoxVE/Cmdlets/Pools/GetPvePoolCmdlet.cs
T
Clint Branham df4cae01bc feat: close API coverage gaps — 51 new cmdlets across 6 areas
Phase 1 — Missing Update/Set operations (10 cmdlets):
- SDN: Set-PveSdnZone/Vnet/Subnet/Controller/Ipam/Dns + Invoke-PveSdnApply
- Set-PveRole, Set-PveStorage, Set-PveApiToken

Phase 2 — Cluster operations (8 cmdlets):
- Get-PveClusterResource (cluster-wide inventory)
- Get-PveTaskList, Stop-PveTask
- Get/New/Set/Remove-PvePool
- Get-PveBackupInfo (unprotected VMs)

Phase 3 — VM & container gaps (14 cmdlets):
- Move-PveVmDisk, Remove-PveVmDisk
- Guest agent: Get-PveVmGuestOsInfo/FsInfo, Read/Write-PveVmGuestFile,
  Set-PveVmGuestPassword, Invoke-PveVmGuestFsTrim
- Suspend/Resume-PveContainer, Resize-PveContainerDisk,
  New-PveContainerTemplate, Move-PveContainerVolume,
  Get-PveContainerInterface

Phase 4 — Storage content management (4 cmdlets):
- Get-PveStorageStatus, Remove/Set-PveStorageContent, New-PveStorageDisk

Phase 5 — Node operations (6 cmdlets):
- Get/Set-PveNodeConfig, Get/Set-PveNodeDns, Start/Stop-PveNodeVms

Phase 6 — Access management (9 cmdlets):
- Get/New/Set/Remove-PveGroup, Get/New/Set/Remove-PveDomain, Set-PvePassword

Total: 169 cmdlets (was 118). Includes models, services, format views,
Pester unit tests, manifest updates, README, CHANGELOG, API coverage docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 09:55:19 -05:00

47 lines
1.6 KiB
C#

using System.Management.Automation;
using PSProxmoxVE.Core.Models.Cluster;
using PSProxmoxVE.Core.Services;
namespace PSProxmoxVE.Cmdlets.Pools
{
/// <summary>
/// <para type="synopsis">Lists Proxmox VE resource pools.</para>
/// <para type="description">
/// Returns resource pool configurations from the Proxmox VE cluster.
/// Optionally filter by pool ID to retrieve a specific pool with its members.
/// </para>
/// </summary>
[Cmdlet(VerbsCommon.Get, "PvePool")]
[OutputType(typeof(PvePool))]
public sealed class GetPvePoolCmdlet : PveCmdletBase
{
/// <summary>
/// <para type="description">The pool ID to retrieve. When omitted, all pools are returned.</para>
/// </summary>
[Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, HelpMessage = "The pool ID to retrieve.")]
public string? PoolId { get; set; }
protected override void ProcessRecord()
{
var session = GetSession();
var service = new PoolService();
if (!string.IsNullOrEmpty(PoolId))
{
WriteVerbose($"Getting pool '{PoolId}'...");
var pool = service.GetPool(session, PoolId!);
WriteObject(pool);
}
else
{
WriteVerbose("Getting all pools...");
var pools = service.GetPools(session);
foreach (var pool in pools)
{
WriteObject(pool);
}
}
}
}
}