From ab4d349303c0e09fffdfdd509348bc93a349d2cf Mon Sep 17 00:00:00 2001 From: Christian Oeser Date: Tue, 3 Sep 2024 11:53:31 +0200 Subject: [PATCH] Removed AvailableTime validation because it is not needed --- Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 | 12 ++---------- Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 | 12 ++---------- Public/Add-IntuneWin32AppAssignmentGroup.ps1 | 12 ++---------- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 b/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 index 02d33d2..ac075ae 100644 --- a/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentAllDevices.ps1 @@ -49,13 +49,14 @@ function Add-IntuneWin32AppAssignmentAllDevices { Author: Nickolaj Andersen Contact: @NickolajA Created: 2020-09-20 - Updated: 2023-09-04 + Updated: 2024-09-03 Version history: 1.0.0 - (2020-09-20) Function created 1.0.1 - (2021-04-01) Updated token expired message to a warning instead of verbose output 1.0.2 - (2021-08-31) Updated to use new authentication header 1.0.3 - (2023-09-04) Updated with Test-AccessToken function + 1.0.4 - (2024-09-03) Removed AvailableTime validation #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -131,15 +132,6 @@ function Add-IntuneWin32AppAssignmentAllDevices { # Set script variable for error action preference $ErrorActionPreference = "Stop" - # Validate that Available parameter input datetime object is in the past if the Deadline parameter is not passed on the command line - if ($PSBoundParameters["AvailableTime"]) { - if (-not($PSBoundParameters["DeadlineTime"])) { - if ($AvailableTime -gt (Get-Date).AddDays(-1)) { - Write-Warning -Message "Validation failed for parameter input, available date time needs to be before the current used 'as soon as possible' deadline date and time, with a offset of 1 day"; break - } - } - } - # Validate that Deadline parameter input datetime object is in the future if the Available parameter is not passed on the command line if ($PSBoundParameters["DeadlineTime"]) { if (-not($PSBoundParameters["AvailableTime"])) { diff --git a/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 b/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 index 7618fac..75fc66e 100644 --- a/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentAllUsers.ps1 @@ -49,13 +49,14 @@ function Add-IntuneWin32AppAssignmentAllUsers { Author: Nickolaj Andersen Contact: @NickolajA Created: 2020-09-20 - Updated: 2023-09-04 + Updated: 2024-09-03 Version history: 1.0.0 - (2020-09-20) Function created 1.0.1 - (2021-04-01) Updated token expired message to a warning instead of verbose output 1.0.2 - (2021-08-31) Updated to use new authentication header 1.0.3 - (2023-09-04) Updated with Test-AccessToken function + 1.0.4 - (2024-09-03) Removed AvailableTime validation #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -131,15 +132,6 @@ function Add-IntuneWin32AppAssignmentAllUsers { # Set script variable for error action preference $ErrorActionPreference = "Stop" - # Validate that Available parameter input datetime object is in the past if the Deadline parameter is not passed on the command line - if ($PSBoundParameters["AvailableTime"]) { - if (-not($PSBoundParameters["DeadlineTime"])) { - if ($AvailableTime -gt (Get-Date).AddDays(-1)) { - Write-Warning -Message "Validation failed for parameter input, available date time needs to be before the current used 'as soon as possible' deadline date and time, with a offset of 1 day"; break - } - } - } - # Validate that Deadline parameter input datetime object is in the future if the Available parameter is not passed on the command line if ($PSBoundParameters["DeadlineTime"]) { if (-not($PSBoundParameters["AvailableTime"])) { diff --git a/Public/Add-IntuneWin32AppAssignmentGroup.ps1 b/Public/Add-IntuneWin32AppAssignmentGroup.ps1 index 69c211a..608d566 100644 --- a/Public/Add-IntuneWin32AppAssignmentGroup.ps1 +++ b/Public/Add-IntuneWin32AppAssignmentGroup.ps1 @@ -58,7 +58,7 @@ function Add-IntuneWin32AppAssignmentGroup { Author: Nickolaj Andersen Contact: @NickolajA Created: 2020-09-20 - Updated: 2023-09-20 + Updated: 2024-09-03 Version history: 1.0.0 - (2020-09-20) Function created @@ -67,6 +67,7 @@ function Add-IntuneWin32AppAssignmentGroup { 1.0.3 - (2021-08-31) Updated to use new authentication header 1.0.4 - (2023-09-04) Updated with Test-AccessToken function 1.0.5 - (2023-09-20) Updated with FilterName and FilterMode parameters + 1.0.6 - (2024-09-03) Removed AvailableTime validation #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -155,15 +156,6 @@ function Add-IntuneWin32AppAssignmentGroup { # Set script variable for error action preference $ErrorActionPreference = "Stop" - # Validate that Available parameter input datetime object is in the past if the Deadline parameter is not passed on the command line - if ($PSBoundParameters["AvailableTime"]) { - if (-not($PSBoundParameters["DeadlineTime"])) { - if ($AvailableTime -gt (Get-Date).AddDays(-1)) { - Write-Warning -Message "Validation failed for parameter input, available date time needs to be before the current used 'as soon as possible' deadline date and time, with a offset of 1 day"; break - } - } - } - # Validate that Deadline parameter input datetime object is in the future if the Available parameter is not passed on the command line if ($PSBoundParameters["DeadlineTime"]) { if (-not($PSBoundParameters["AvailableTime"])) {