Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed AvailableTime validation because it is not needed #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions Public/Add-IntuneWin32AppAssignmentAllDevices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"])) {
Expand Down
12 changes: 2 additions & 10 deletions Public/Add-IntuneWin32AppAssignmentAllUsers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"])) {
Expand Down
12 changes: 2 additions & 10 deletions Public/Add-IntuneWin32AppAssignmentGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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"])) {
Expand Down