diff --git a/src/PSProxmoxVE.Core/Services/NetworkService.cs b/src/PSProxmoxVE.Core/Services/NetworkService.cs index 18d61e1..667c1ff 100644 --- a/src/PSProxmoxVE.Core/Services/NetworkService.cs +++ b/src/PSProxmoxVE.Core/Services/NetworkService.cs @@ -11,7 +11,7 @@ namespace PSProxmoxVE.Core.Services { /// /// Service for Proxmox VE node network and SDN (Software-Defined Networking) API operations. - /// SDN methods require PVE 8.0 or later and will throw otherwise. + /// SDN methods require PVE 8.0 or later. Version checks are performed at the cmdlet layer. /// public class NetworkService { diff --git a/src/PSProxmoxVE/Cmdlets/Backup/NewPveBackupJobCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Backup/NewPveBackupJobCmdlet.cs index 2a9ffe2..57a14fe 100644 --- a/src/PSProxmoxVE/Cmdlets/Backup/NewPveBackupJobCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Backup/NewPveBackupJobCmdlet.cs @@ -73,10 +73,10 @@ namespace PSProxmoxVE.Cmdlets.Backup public string? MailNotification { get; set; } /// - /// Whether the backup job is enabled. Default is true. + /// Whether the backup job is enabled. Enabled by default unless -Enabled:$false is specified. /// - [Parameter(Mandatory = false, HelpMessage = "Whether the backup job is enabled.")] - public SwitchParameter Enabled { get; set; } = true; + [Parameter(Mandatory = false, HelpMessage = "Whether the backup job is enabled. Default is enabled.")] + public SwitchParameter Enabled { get; set; } /// /// A comment or description for the backup job. @@ -102,7 +102,7 @@ namespace PSProxmoxVE.Cmdlets.Backup { ["schedule"] = Schedule, ["storage"] = Storage, - ["enabled"] = Enabled.IsPresent ? "1" : "0" + ["enabled"] = MyInvocation.BoundParameters.ContainsKey("Enabled") && !Enabled.IsPresent ? "0" : "1" }; if (!string.IsNullOrEmpty(Mode)) config["mode"] = Mode!; diff --git a/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 b/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 index 08aa5ae..34b5103 100644 --- a/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 +++ b/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 @@ -1443,7 +1443,7 @@ Describe 'Integration Tests' -Tag 'Integration' { Context 'Backup Jobs' { It 'Should create a backup job' { Skip-IfNoTarget - { New-PveBackupJob -Schedule 'sat 03:00' -Storage $script:Storage -Mode snapshot -Comment 'pester-test-backup' -ErrorAction Stop } | Should -Not -Throw + { New-PveBackupJob -Schedule 'sat 03:00' -Storage $script:Storage -Mode snapshot -All -Comment 'pester-test-backup' -ErrorAction Stop } | Should -Not -Throw } It 'Should list backup jobs and find the test job' {