From c5d6cde6eb5c1ee034addd6036c0d8477c5df866 Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Tue, 17 Mar 2026 15:47:52 -0500 Subject: [PATCH] feat(format): add ps1xml format definitions and module manifest Define default Format-Table views for PveVm, PveNode, PveStorage, PveTask, PveSnapshot, PveContainer, and PveUser. Add module manifest with all 60+ cmdlets explicitly listed, PowerShell 5.1+ compatibility, and prerelease tag. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/PSProxmoxVE/PSProxmoxVE.format.ps1xml | 446 ++++++++++++++++++++++ src/PSProxmoxVE/PSProxmoxVE.psd1 | 187 +++++++++ 2 files changed, 633 insertions(+) create mode 100644 src/PSProxmoxVE/PSProxmoxVE.format.ps1xml create mode 100644 src/PSProxmoxVE/PSProxmoxVE.psd1 diff --git a/src/PSProxmoxVE/PSProxmoxVE.format.ps1xml b/src/PSProxmoxVE/PSProxmoxVE.format.ps1xml new file mode 100644 index 0000000..6535d44 --- /dev/null +++ b/src/PSProxmoxVE/PSProxmoxVE.format.ps1xml @@ -0,0 +1,446 @@ + + + + + + + PSProxmoxVE.Core.Models.Nodes.PveNode + + PSProxmoxVE.Core.Models.Nodes.PveNode + + + + + + 15 + Left + + + + 10 + Left + + + + 5 + Right + + + + 15 + Right + + + + 12 + Left + + + + 12 + Left + + + + + + + Name + + + Status + + + CpuCount + + + [math]::Round($_.MemoryTotal / 1GB, 1).ToString() + ' GB' + + + + $ts = [TimeSpan]::FromSeconds($_.Uptime) + '{0}d {1:D2}:{2:D2}' -f [int]$ts.TotalDays, $ts.Hours, $ts.Minutes + + + + PveVersion + + + + + + + + + + PSProxmoxVE.Core.Models.Vms.PveVm + + PSProxmoxVE.Core.Models.Vms.PveVm + + + + + + 8 + Right + + + + 20 + Left + + + + 10 + Left + + + + 15 + Left + + + + 5 + Right + + + + 12 + Right + + + + 12 + Left + + + + + + + VmId + + + Name + + + Status + + + Node + + + CpuCount + + + [math]::Round($_.MaxMem / 1GB, 1).ToString() + ' GB' + + + + $ts = [TimeSpan]::FromSeconds($_.Uptime) + '{0}d {1:D2}:{2:D2}' -f [int]$ts.TotalDays, $ts.Hours, $ts.Minutes + + + + + + + + + + + PSProxmoxVE.Core.Models.Containers.PveContainer + + PSProxmoxVE.Core.Models.Containers.PveContainer + + + + + + 8 + Right + + + + 20 + Left + + + + 10 + Left + + + + 15 + Left + + + + 12 + Right + + + + + + + VmId + + + Name + + + Status + + + Node + + + [math]::Round($_.MaxMem / 1GB, 1).ToString() + ' GB' + + + + + + + + + + PSProxmoxVE.Core.Models.Storage.PveStorage + + PSProxmoxVE.Core.Models.Storage.PveStorage + + + + + + 20 + Left + + + + 12 + Left + + + + 20 + Left + + + + 12 + Right + + + + 12 + Right + + + + 6 + Left + + + + + + + Storage + + + Type + + + Content + + + [math]::Round($_.Used / 1GB, 1).ToString() + ' GB' + + + [math]::Round($_.Total / 1GB, 1).ToString() + ' GB' + + + Active + + + + + + + + + + PSProxmoxVE.Core.Models.PveTask + + PSProxmoxVE.Core.Models.PveTask + + + + + + 40 + Left + + + + 15 + Left + + + + 10 + Left + + + + 15 + Left + + + + + + + Upid + + + Type + + + Status + + + ExitStatus + + + + + + + + + + PSProxmoxVE.Core.Models.PveSnapshot + + PSProxmoxVE.Core.Models.PveSnapshot + + + + + + 20 + Left + + + + 20 + Left + + + + 30 + Left + + + + 8 + Left + + + + + + + Name + + + + if ($_.SnapTime) { + [System.DateTimeOffset]::FromUnixTimeSeconds($_.SnapTime).LocalDateTime.ToString('yyyy-MM-dd HH:mm:ss') + } + + + + Description + + + VmState + + + + + + + + + + PSProxmoxVE.Core.Models.Users.PveUser + + PSProxmoxVE.Core.Models.Users.PveUser + + + + + + 25 + Left + + + + 15 + Left + + + + 15 + Left + + + + 25 + Left + + + + 8 + Left + + + + 10 + Left + + + + + + + UserId + + + FirstName + + + LastName + + + Email + + + Enabled + + + Realm + + + + + + + + + diff --git a/src/PSProxmoxVE/PSProxmoxVE.psd1 b/src/PSProxmoxVE/PSProxmoxVE.psd1 new file mode 100644 index 0000000..87e5dd9 --- /dev/null +++ b/src/PSProxmoxVE/PSProxmoxVE.psd1 @@ -0,0 +1,187 @@ +# +# Module manifest for module 'PSProxmoxVE' +# +# Generated on: 2026-03-17 +# + +@{ + + # Script module or binary module file associated with this manifest. + RootModule = 'PSProxmoxVE.dll' + + # Version number of this module. + ModuleVersion = '0.1.0' + + # Supported PSEditions + CompatiblePSEditions = @('Desktop', 'Core') + + # ID used to uniquely identify this module + GUID = 'a3f7c2d1-84e5-4b9f-a061-3e2d8c5f1a7b' + + # Author of this module + Author = 'goodolclint' + + # Company or vendor of this module + CompanyName = 'Worklab' + + # Copyright statement for this module + Copyright = '(c) 2026 goodolclint. All rights reserved.' + + # Description of the functionality provided by this module + Description = 'PowerShell module for managing Proxmox VE environments. Supports PVE 8.x and 9.x with full VM, container, storage, network, and cluster management capabilities.' + + # Minimum version of the PowerShell engine required by this module + PowerShellVersion = '5.1' + + # Minimum version of the .NET Framework required by this module + DotNetFrameworkVersion = '4.8' + + # Assemblies that must be loaded prior to importing this module + RequiredAssemblies = @( + 'PSProxmoxVE.Core.dll', + 'Newtonsoft.Json.dll' + ) + + # Format files (.ps1xml) to be loaded when importing this module + FormatsToProcess = @('PSProxmoxVE.format.ps1xml') + + # Functions to export from this module + FunctionsToExport = @() + + # Cmdlets to export from this module + CmdletsToExport = @( + # Connection + 'Connect-PveServer', + 'Disconnect-PveServer', + 'Test-PveConnection', + + # Nodes + 'Get-PveNode', + 'Get-PveNodeStatus', + + # Virtual Machines + 'Get-PveVm', + 'New-PveVm', + 'Remove-PveVm', + 'Start-PveVm', + 'Stop-PveVm', + 'Suspend-PveVm', + 'Resume-PveVm', + 'Reset-PveVm', + 'Restart-PveVm', + 'Copy-PveVm', + 'Move-PveVm', + 'Get-PveVmConfig', + 'Set-PveVmConfig', + 'Resize-PveVmDisk', + + # Containers + 'Get-PveContainer', + 'New-PveContainer', + 'Remove-PveContainer', + 'Start-PveContainer', + 'Stop-PveContainer', + 'Restart-PveContainer', + 'Copy-PveContainer', + 'Get-PveContainerConfig', + 'Set-PveContainerConfig', + + # Storage + 'Get-PveStorage', + 'Get-PveStorageContent', + 'Send-PveIso', + 'Invoke-PveStorageDownload', + 'New-PveStorage', + 'Remove-PveStorage', + + # Snapshots + 'Get-PveSnapshot', + 'New-PveSnapshot', + 'Remove-PveSnapshot', + 'Restore-PveSnapshot', + + # Networking + 'Get-PveNetwork', + 'New-PveNetwork', + 'Set-PveNetwork', + 'Remove-PveNetwork', + 'Invoke-PveNetworkApply', + + # SDN - Zones + 'Get-PveSdnZone', + 'New-PveSdnZone', + 'Remove-PveSdnZone', + + # SDN - VNets + 'Get-PveSdnVnet', + 'New-PveSdnVnet', + 'Remove-PveSdnVnet', + + # Users + 'Get-PveUser', + 'New-PveUser', + 'Remove-PveUser', + 'Set-PveUser', + + # Roles + 'Get-PveRole', + 'New-PveRole', + 'Remove-PveRole', + + # Permissions + 'Get-PvePermission', + 'Set-PvePermission', + + # Templates + 'Get-PveTemplate', + 'New-PveTemplate', + 'Remove-PveTemplate', + 'New-PveVmFromTemplate', + + # Cloud-Init + 'Get-PveCloudInitConfig', + 'Set-PveCloudInitConfig', + 'Invoke-PveCloudInitRegenerate', + + # Tasks + 'Get-PveTask', + 'Wait-PveTask' + ) + + # Variables to export from this module + VariablesToExport = @() + + # Aliases to export from this module + AliasesToExport = @() + + # Private data to pass to the module specified in RootModule + PrivateData = @{ + + PSData = @{ + + # Prerelease string for the module + Prerelease = 'preview' + + # Tags applied to this module + Tags = @( + 'Proxmox', + 'ProxmoxVE', + 'PVE', + 'Virtualization', + 'IaC', + 'Homelab', + 'ProxmoxVE8', + 'ProxmoxVE9' + ) + + # URI to the license for this module + LicenseUri = 'https://github.com/goodolclint/PSProxmoxVE/blob/main/LICENSE' + + # URI to the project for this module + ProjectUri = 'https://github.com/goodolclint/PSProxmoxVE' + + } + + } + +}