From bfe2483d2244ffbc2ca070c5794bfef3e1217f57 Mon Sep 17 00:00:00 2001 From: "goodolclint-claude[bot]" <323206664+goodolclint-claude[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2026 19:34:11 +0000 Subject: [PATCH] fix: drop the client-side -Storage/-Full guard from the Copy cmdlets PVE returns the same error itself when storage is sent on a linked clone, so the guard only saved one round trip, had no test, and rested on a behaviour claim the OpenAPI spec does not document. --- .../Cmdlets/Containers/CopyPveContainerCmdlet.cs | 9 +-------- src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs | 7 ------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/PSProxmoxVE/Cmdlets/Containers/CopyPveContainerCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Containers/CopyPveContainerCmdlet.cs index 4d66f4c..54f2394 100644 --- a/src/PSProxmoxVE/Cmdlets/Containers/CopyPveContainerCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Containers/CopyPveContainerCmdlet.cs @@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Containers protected override void ProcessRecord() { - if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent) - ThrowTerminatingError(new ErrorRecord( - new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)), - "StorageRequiresFullClone", - ErrorCategory.InvalidArgument, - Storage)); - var target = TargetNode ?? SourceNode; if (!ShouldProcess($"Container {VmId} on node '{SourceNode}' to new container on node '{target}'", "Copy-PveContainer")) return; @@ -103,7 +96,7 @@ namespace PSProxmoxVE.Cmdlets.Containers if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!, null, null, null); + task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs index 9151ecc..4180937 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs @@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Vms protected override void ProcessRecord() { - if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent) - ThrowTerminatingError(new ErrorRecord( - new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)), - "StorageRequiresFullClone", - ErrorCategory.InvalidArgument, - Storage)); - var target = TargetNode ?? SourceNode; if (!ShouldProcess($"VM {VmId} on node '{SourceNode}' to new VM on node '{target}'", "Copy-PveVm")) return;