Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#406 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to hotfix
  • Loading branch information
KelvinTegelaar authored Aug 16, 2023
2 parents 978c8ba + 513c1b5 commit 56c6b53
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
18 changes: 11 additions & 7 deletions BestPracticeAnalyser_Orchestration/run.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
param($Context)


$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
BackoffCoefficient = 2
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions
Write-LogMessage -API 'BestPracticeAnalyser' -tenant $tenant -message "Started BestPracticeAnalyser" -sev info
Write-LogMessage -API 'BestPracticeAnalyser' -tenant $tenant -message 'Started BestPracticeAnalyser' -sev info

if ($Context.Input -and ![string]::IsNullOrEmpty([string]$Context.Input.TenantFilter)) {
$Batch = @([string]$Context.Input.TenantFilter)
} else {
$Batch = (Invoke-ActivityFunction -FunctionName 'BestPracticeAnalyser_GetQueue' -Input 'LetsGo')
}

$Batch = (Invoke-ActivityFunction -FunctionName 'BestPracticeAnalyser_GetQueue' -Input 'LetsGo')
$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName 'BestPracticeAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
Invoke-DurableActivity -FunctionName 'BestPracticeAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
}

Write-LogMessage -API 'BestPracticeAnalyser' -tenant $tenant -message 'Best Practice Analyser has Finished' -sev Info
16 changes: 9 additions & 7 deletions BestPracticeAnalyser_OrchestrationStarter/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ using namespace System.Net

param($Request, $TriggerMetadata)
if ($CurrentlyRunning) {
$Results = [pscustomobject]@{"Results" = "Already running. Please wait for the current instance to finish" }
Write-LogMessage -API "BestPracticeAnalyser" -message "Attempted to start analysis but an instance was already running." -sev Info
}
else {
$InstanceId = Start-NewOrchestration -FunctionName 'BestPracticeAnalyser_Orchestration'
$Results = [pscustomobject]@{'Results' = 'Already running. Please wait for the current instance to finish' }
Write-LogMessage -API 'BestPracticeAnalyser' -message 'Attempted to start analysis but an instance was already running.' -sev Info
} else {
$InputObject = @{
TenantFilter = $Request.Query.TenantFilter
}
$InstanceId = Start-NewOrchestration -FunctionName 'BestPracticeAnalyser_Orchestration' -InputObject $InputObject
Write-Host "Started orchestration with ID = '$InstanceId'"
$Orchestrator = New-OrchestrationCheckStatusResponse -Request $Request -InstanceId $InstanceId
Write-LogMessage -API "BestPracticeAnalyser" -message "Started retrieving best practice information" -sev Info
$Results = [pscustomobject]@{"Results" = "Started running analysis" }
Write-LogMessage -API 'BestPracticeAnalyser' -message 'Started retrieving best practice information' -sev Info
$Results = [pscustomobject]@{'Results' = 'Started running analysis' }
}
Write-Host ($Orchestrator | ConvertTo-Json)

Expand Down
2 changes: 1 addition & 1 deletion Config/CIPPDefaultTable.BPATemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"API": "Exchange",
"Command": "Get-Mailbox",
"Parameters": {
"RecipientTypeDetails": "SharedMailbox"
"RecipientTypeDetails": ["SharedMailbox", "UserMailbox"]
},
"where": "$_.MessageCopyForSentAsEnabled -eq $false",
"ExtractFields": ["userprincipalname", "messageCopyForSentAsEnabled"],
Expand Down
2 changes: 1 addition & 1 deletion Scheduler_Alert/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ try {
}
{ $_.'ExpiringLicenses' -eq $true } {
try {
Get-CIPPLicenseOverview -TenantFilter $Tenant.tenant | Where-Object -Property TimeUntilRenew -LT 31 | ForEach-Object {
Get-CIPPLicenseOverview -TenantFilter $Tenant.tenant | Where-Object -Property TimeUntilRenew -LT 29 | ForEach-Object {
"$($_.License) will expire in $($_.TimeUntilRenew) days"
}
}
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.1

0 comments on commit 56c6b53

Please sign in to comment.