From 23177075f9bc0a78d4fb2c5e1203892d7632e4cb Mon Sep 17 00:00:00 2001 From: ThomasSteendijk <52360610+ThomasSteendijk@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:04:01 +0100 Subject: [PATCH] Fix: ValidateRange works not as intended because the values are quoted (string) instead of numbers. Fixed by removing quotes. --- Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 | 6 +++--- Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 | 6 +++--- Public/Add-IntuneWin32AppAssignmentGroup.ps1 | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 b/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 index 4fcdd54..02d33d2 100644 --- a/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 @@ -96,17 +96,17 @@ function Add-IntuneWin32AppAssignmentAllDevices { [parameter(Mandatory = $false, HelpMessage = "Specify the device restart grace period in minutes.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "20160")] + [ValidateRange(1, 20160)] [int]$RestartGracePeriod = 1440, [parameter(Mandatory = $false, HelpMessage = "Specify a count in minutes when the restart count down display box is shown.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "240")] + [ValidateRange(1, 240)] [int]$RestartCountDownDisplay = 15, [parameter(Mandatory = $false, HelpMessage = "Specify a count in minutes for snoozing the restart notification, if not specified the snooze functionality is now allowed.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "712")] + [ValidateRange(1, 712)] [int]$RestartNotificationSnooze = 240, [parameter(Mandatory = $false, HelpMessage = "Specify the name of an existing Filter.")] diff --git a/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 b/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 index 68c257d..7618fac 100644 --- a/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 @@ -96,17 +96,17 @@ function Add-IntuneWin32AppAssignmentAllUsers { [parameter(Mandatory = $false, HelpMessage = "Specify the device restart grace period in minutes.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "20160")] + [ValidateRange(1, 20160)] [int]$RestartGracePeriod = 1440, [parameter(Mandatory = $false, HelpMessage = "Specify a count in minutes when the restart count down display box is shown.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "240")] + [ValidateRange(1, 240)] [int]$RestartCountDownDisplay = 15, [parameter(Mandatory = $false, HelpMessage = "Specify a count in minutes for snoozing the restart notification, if not specified the snooze functionality is now allowed.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "712")] + [ValidateRange(1, 712)] [int]$RestartNotificationSnooze = 240, [parameter(Mandatory = $false, HelpMessage = "Specify the name of an existing Filter.")] diff --git a/Public/Add-IntuneWin32AppAssignmentGroup.ps1 b/Public/Add-IntuneWin32AppAssignmentGroup.ps1 index bde4ea8..69c211a 100644 --- a/Public/Add-IntuneWin32AppAssignmentGroup.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentGroup.ps1 @@ -120,17 +120,17 @@ function Add-IntuneWin32AppAssignmentGroup { [parameter(Mandatory = $false, ParameterSetName = "GroupInclude", HelpMessage = "Specify the device restart grace period in minutes.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "20160")] + [ValidateRange(1, 20160)] [int]$RestartGracePeriod = 1440, [parameter(Mandatory = $false, ParameterSetName = "GroupInclude", HelpMessage = "Specify a count in minutes when the restart count down display box is shown.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "240")] + [ValidateRange(1, 240)] [int]$RestartCountDownDisplay = 15, [parameter(Mandatory = $false, ParameterSetName = "GroupInclude", HelpMessage = "Specify a count in minutes for snoozing the restart notification, if not specified the snooze functionality is now allowed.")] [ValidateNotNullOrEmpty()] - [ValidateRange("1", "712")] + [ValidateRange(1, 712)] [int]$RestartNotificationSnooze = 240, [parameter(Mandatory = $false, ParameterSetName = "GroupInclude", HelpMessage = "Specify the name of an existing Filter.")]