Skip to content

Commit 2a4e160

Browse files
authored
Merge pull request #1103 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 9c65f4b + 012e8d1 commit 2a4e160

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

Modules/CIPPCore/Public/Set-CIPPCPVConsent.ps1

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ function Set-CIPPCPVConsent {
2121
return @('Application is already consented to this tenant')
2222
}
2323

24-
# Skip the Partner Center POST if consent was applied recently and we're not resetting
25-
if (-not $ResetSP) {
26-
$CpvTable = Get-CIPPTable -TableName cpvtenants
27-
$ExistingRow = Get-CIPPAzDataTableEntity @CpvTable -Filter "PartitionKey eq 'Tenant' and RowKey eq '$TenantFilter'"
28-
if ($ExistingRow -and $ExistingRow.applicationId -eq $env:ApplicationID -and $ExistingRow.LastApply) {
29-
$UnixNow = [int64](([datetime]::UtcNow) - (Get-Date '1/1/1970')).TotalSeconds
30-
if (($UnixNow - [int64]$ExistingRow.LastApply) -lt 86400) {
31-
return @("CPV consent for $TenantName is current, skipping re-consent")
32-
}
33-
}
34-
}
35-
3624
if ($ResetSP) {
3725
try {
3826
if ($PSCmdlet.ShouldProcess($env:ApplicationID, "Delete Service Principal from $TenantName")) {

0 commit comments

Comments
 (0)