From fa8d9f7f01af5ae35ff9e9b5aa16be2155268851 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 1 Feb 2024 10:00:28 +0100 Subject: [PATCH] Global(System): Fix Validaterange for Admin Timeout --- PowerFGT/Public/cmdb/system/global.ps1 | 2 +- Tests/integration/SystemGlobal.Tests.ps1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerFGT/Public/cmdb/system/global.ps1 b/PowerFGT/Public/cmdb/system/global.ps1 index 38fcf5288..03b083268 100644 --- a/PowerFGT/Public/cmdb/system/global.ps1 +++ b/PowerFGT/Public/cmdb/system/global.ps1 @@ -131,7 +131,7 @@ function Set-FGTSystemGlobal { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'medium')] Param( [Parameter (Mandatory = $false)] - [ValidateRange("1", "480")] + [ValidateRange(1, 480)] [int]$admintimeout, [Parameter (Mandatory = $false)] [ValidateRange(1, 65535)] diff --git a/Tests/integration/SystemGlobal.Tests.ps1 b/Tests/integration/SystemGlobal.Tests.ps1 index 64c20abc0..726a6aec2 100644 --- a/Tests/integration/SystemGlobal.Tests.ps1 +++ b/Tests/integration/SystemGlobal.Tests.ps1 @@ -53,10 +53,10 @@ Describe "Set System Global" { $script:settings = Get-FGTSystemGlobal } - It "Change admintimeout to 480" { - Set-FGTSystemGlobal -admintimeout 480 + It "Change admintimeout to 60" { + Set-FGTSystemGlobal -admintimeout 60 $sg = Get-FGTSystemGlobal - $sg.'admintimeout' | Should -Be "480" + $sg.'admintimeout' | Should -Be "60" } It "Change admin_port (HTTP)" -Skip:($httpOnly -or $ci) {