forked from KelvinTegelaar/CIPP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:master' into master
- Loading branch information
Showing
249 changed files
with
1,293 additions
and
823 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Modules/CIPPCore/Public/CippQueue/Invoke-ListCippQueue.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function Invoke-ListCippQueue { | ||
# Input bindings are passed in via param block. | ||
param($Request = $null, $TriggerMetadata) | ||
|
||
if ($Request) { | ||
$APIName = $TriggerMetadata.FunctionName | ||
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' | ||
|
||
# Write to the Azure Functions log stream. | ||
Write-Host 'PowerShell HTTP trigger function processed a request.' | ||
} | ||
|
||
$CippQueue = Get-CippTable -TableName 'CippQueue' | ||
$CippQueueData = Get-CIPPAzDataTableEntity @CippQueue | Where-Object { ($_.Timestamp.DateTime) -ge (Get-Date).ToUniversalTime().AddHours(-1) } | Sort-Object -Property Timestamp -Descending | ||
if ($request) { | ||
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ | ||
StatusCode = [HttpStatusCode]::OK | ||
Body = @($CippQueueData) | ||
}) | ||
} else { | ||
return $CippQueueData | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Modules/CIPPCore/Public/CippQueue/Invoke-RemoveCippQueue.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function Invoke-RemoveCippQueue { | ||
# Input bindings are passed in via param block. | ||
param($Request, $TriggerMetadata) | ||
|
||
$APIName = $TriggerMetadata.FunctionName | ||
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' | ||
|
||
# Write to the Azure Functions log stream. | ||
Write-Host 'PowerShell HTTP trigger function processed a request.' | ||
|
||
$CippQueue = Get-CippTable -TableName 'CippQueue' | ||
Clear-AzDataTable @CippQueue | ||
|
||
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ | ||
StatusCode = [HttpStatusCode]::OK | ||
Body = @{Results = @('History cleared') } | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function New-CippQueueEntry { | ||
Param( | ||
$Name, | ||
$Link, | ||
$Reference | ||
) | ||
|
||
$CippQueue = Get-CippTable -TableName CippQueue | ||
|
||
$QueueEntry = @{ | ||
PartitionKey = 'CippQueue' | ||
RowKey = (New-Guid).Guid.ToString() | ||
Name = $Name | ||
Link = $Link | ||
Reference = $Reference | ||
Status = 'Queued' | ||
} | ||
$CippQueue.Entity = $QueueEntry | ||
|
||
Add-CIPPAzDataTableEntity @CippQueue | ||
|
||
$QueueEntry | ||
} |
29 changes: 29 additions & 0 deletions
29
Modules/CIPPCore/Public/CippQueue/Update-CippQueueEntry.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function Update-CippQueueEntry { | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
$RowKey, | ||
$Status, | ||
$Name | ||
) | ||
|
||
$CippQueue = Get-CippTable -TableName CippQueue | ||
|
||
if ($RowKey) { | ||
$QueueEntry = Get-CIPPAzDataTableEntity @CippQueue -Filter ("RowKey eq '{0}'" -f $RowKey) | ||
|
||
if ($QueueEntry) { | ||
if ($Status) { | ||
$QueueEntry.Status = $Status | ||
} | ||
if ($Name) { | ||
$QueueEntry.Name = $Name | ||
} | ||
Update-AzDataTableEntity @CippQueue -Entity $QueueEntry | ||
$QueueEntry | ||
} else { | ||
return $false | ||
} | ||
} else { | ||
return $false | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-CIPPAlertNewAppApproval.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
function Push-CIPPAlertNewAppApproval { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[pscustomobject]$Item | ||
) | ||
try { | ||
$Approvals = New-GraphGetRequest -Uri 'https://graph.microsoft.com/beta/identityGovernance/appConsent/appConsentRequests' -tenantid $item.tenant | ||
if ($Approvals.count -gt 1) { | ||
Write-AlertMessage -tenant $($Item.tenant) -message "There is are $($Approvals.count) App Approvals waiting." | ||
} | ||
} catch { | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-GetPendingWebhooks.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function Push-GetPendingWebhooks { | ||
$Table = Get-CIPPTable -TableName WebhookIncoming | ||
$Webhooks = Get-CIPPAzDataTableEntity @Table | ||
$WebhookCount = ($Webhooks | Measure-Object).Count | ||
$Message = 'Processing {0} webhooks' -f $WebhookCount | ||
Write-LogMessage -API 'Webhooks' -message $Message -sev Info | ||
return $Webhooks | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.