Skip to content

Commit 54b9fcd

Browse files
authored
Merge pull request #63 from KelvinTegelaar/master
[pull] master from KelvinTegelaar:master
2 parents cfd9978 + 99c417b commit 54b9fcd

File tree

13 files changed

+68
-21
lines changed

13 files changed

+68
-21
lines changed

Diff for: .github/workflows/dev_cipppwrro.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Powershell project to Azure Function App - cipppwrro
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
runs-on: windows-latest
18+
19+
steps:
20+
- name: 'Checkout GitHub Action'
21+
uses: actions/checkout@v4
22+
23+
- name: 'Run Azure Functions Action'
24+
uses: Azure/functions-action@v1
25+
id: fa
26+
with:
27+
app-name: 'cipppwrro'
28+
slot-name: 'Production'
29+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D5D7DFF930C04B519206F25DDCD88324 }}

Diff for: Modules/CIPPCore/Public/Alerts/Get-CippBreachAlert.ps1 renamed to Modules/CIPPCore/Public/Alerts/Get-CippAlertBreachAlert.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
function Get-CippBreachAlert {
2+
function Get-CippAlertBreachAlert {
33
<#
44
.FUNCTIONALITY
55
Entrypoint

Diff for: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecCippFunction.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ function Invoke-ExecCippFunction {
2828
if (Get-Command -Module CIPPCore -Name $Function -and $BlockList -notcontains $Function) {
2929
try {
3030
$Results = & $Function @Params
31+
if (!$Results) {
32+
$Results = "Function $Function executed successfully"
33+
}
3134
$StatusCode = [HttpStatusCode]::OK
3235
} catch {
3336
$Results = $_.Exception.Message

Diff for: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecPartnerMode.ps1

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ Function Invoke-ExecPartnerMode {
3535
} catch {
3636
}
3737
}
38+
} elseif ($Request.Body.TenantMode -eq 'PartnerTenantAvailable') {
39+
$InputObject = [PSCustomObject]@{
40+
Batch = @(
41+
@{
42+
FunctionName = 'UpdateTenants'
43+
}
44+
)
45+
OrchestratorName = 'UpdateTenants'
46+
SkipLog = $true
47+
}
48+
Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Compress -Depth 5)
3849
}
3950

4051
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{

Diff for: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-AddIntuneTemplate.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Function Invoke-AddIntuneTemplate {
3838

3939
$body = [pscustomobject]@{'Results' = 'Successfully added template' }
4040
} else {
41-
$TenantFilter = $Request.Query.tenantFilter
42-
$URLName = $Request.Query.URLName
43-
$ID = $Request.Query.id
41+
$TenantFilter = $Request.Body.tenantFilter ?? $Request.Query.tenantFilter
42+
$URLName = $Request.Body.URLName ?? $Request.Query.URLName
43+
$ID = $Request.Body.ID ?? $Request.Query.ID
4444
$Template = New-CIPPIntuneTemplate -TenantFilter $TenantFilter -URLName $URLName -ID $ID
4545
Write-Host "Template: $Template"
4646
$object = [PSCustomObject]@{

Diff for: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-AddGuest.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Function Invoke-AddGuest {
3434
}
3535
}
3636
$bodyToShip = ConvertTo-Json -Depth 10 -InputObject $BodyToship -Compress
37-
$GraphRequest = New-GraphPostRequest -uri 'https://graph.microsoft.com/beta/invitations' -tenantFilter $Userobj.tenantFilter -type POST -body $BodyToship -verbose
37+
$GraphRequest = New-GraphPostRequest -uri 'https://graph.microsoft.com/beta/invitations' -tenantid $Userobj.tenantFilter -type POST -body $BodyToship -verbose
3838
if ($Userobj.sendInvite -eq 'true') {
3939
$results.add('Invited Guest. Invite Email sent')
4040
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($userobj.tenantFilter) -message "Invited Guest $($userobj.displayname) with Email Invite " -Sev 'Info'

Diff for: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardConvert.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function Invoke-ExecStandardConvert {
162162

163163
if ($Tenant -eq 'AllTenants' -and $Excluded) {
164164
$ExcludedArr = $Excluded | ForEach-Object { $_ }
165-
$NewTemplate | Add-Member -NotePropertyName 'excludedTenants' -NotePropertyValue $ExcludedArr -Force
165+
$NewTemplate | Add-Member -NotePropertyName 'excludedTenants' -NotePropertyValue @($ExcludedArr) -Force
166166
}
167167

168168
return $NewTemplate

Diff for: Modules/CIPPCore/Public/Entrypoints/Invoke-ListIntuneTemplates.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Function Invoke-ListIntuneTemplates {
4141
$data | Add-Member -NotePropertyName 'displayName' -NotePropertyValue $_.Displayname -Force
4242
$data | Add-Member -NotePropertyName 'description' -NotePropertyValue $_.Description -Force
4343
$data | Add-Member -NotePropertyName 'Type' -NotePropertyValue $_.Type -Force
44-
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.GUID -Force
44+
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.RowKey -Force
4545
$data
4646
} | Sort-Object -Property displayName
4747
}

Diff for: Modules/CIPPCore/Public/Get-CIPPTimerFunctions.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ function Get-CIPPTimerFunctions {
133133
Parameters = $Orchestrator.Parameters ?? @{}
134134
Cron = $CronString
135135
NextOccurrence = $NextOccurrence.ToUniversalTime()
136-
LastOccurrence = $Status.LastOccurrence.DateTime
136+
LastOccurrence = $Status.LastOccurrence
137137
Status = $Status.Status
138138
OrchestratorId = $Status.OrchestratorId
139139
RunOnProcessor = $Orchestrator.RunOnProcessor
140140
IsSystem = $Orchestrator.IsSystem ?? $false
141141
PreferredProcessor = $Orchestrator.PreferredProcessor ?? ''
142+
ErrorMsg = $Status.ErrorMsg ?? ''
142143
}
143144
}
144145
} else {

Diff for: Modules/CIPPCore/Public/GraphHelper/Get-AuthorisedRequest.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ function Get-AuthorisedRequest {
1212
if (!$TenantID) {
1313
$TenantID = $env:TenantID
1414
}
15+
1516
if ($Uri -like 'https://graph.microsoft.com/beta/contracts*' -or $Uri -like '*/customers/*' -or $Uri -eq 'https://graph.microsoft.com/v1.0/me/sendMail' -or $Uri -like '*/tenantRelationships/*' -or $Uri -like '*/security/partner/*') {
1617
return $true
1718
}
18-
$Tenants = Get-Tenants -IncludeErrors
19-
$SkipList = Get-Tenants -SkipList
19+
$Tenant = Get-Tenants -TenantFilter $TenantID | Where-Object { $_.Excluded -eq $false }
2020

21-
if (($SkipList.customerId -notcontains $TenantID -and $SkipList.defaultDomainName -notcontains $TenantID) -or (($Tenants.customerId -contains $TenantID -or $Tenants.defaultDomainName -contains $TenantID) -and $TenantID -ne $env:TenantID)) {
21+
if ($Tenant) {
2222
return $true
2323
} else {
2424
return $false

Diff for: Modules/CIPPCore/Public/GraphHelper/Get-Tenants.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function Get-Tenants {
5050

5151
$IncludedTenantsCache = Get-CIPPAzDataTableEntity @TenantsTable -Filter $Filter
5252

53-
if (($IncludedTenantsCache | Measure-Object).Count -eq 0) {
53+
if (($IncludedTenantsCache | Measure-Object).Count -eq 0 -and $TenantFilter -ne $env:TenantID) {
5454
$BuildRequired = $true
5555
}
5656

Diff for: Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ function New-GraphGetRequest {
33
.FUNCTIONALITY
44
Internal
55
#>
6+
[CmdletBinding()]
67
Param(
7-
$uri,
8-
$tenantid,
9-
$scope,
10-
$AsApp,
11-
$noPagination,
12-
$NoAuthCheck,
13-
$skipTokenCache,
8+
[string]$uri,
9+
[string]$tenantid,
10+
[string]$scope,
11+
[bool]$AsApp,
12+
[bool]$noPagination,
13+
[bool]$NoAuthCheck,
14+
[bool]$skipTokenCache,
1415
$Caller,
1516
[switch]$ComplexFilter,
1617
[switch]$CountOnly,
1718
[switch]$IncludeResponseHeaders
1819
)
20+
$IsAuthorised = Get-AuthorisedRequest -Uri $uri -TenantID $tenantid
1921

20-
if ($NoAuthCheck -or (Get-AuthorisedRequest -Uri $uri -TenantID $tenantid)) {
22+
if ($NoAuthCheck -eq $true -or $IsAuthorised) {
2123
if ($scope -eq 'ExchangeOnline') {
2224
$AccessToken = Get-ClassicAPIToken -resource 'https://outlook.office365.com' -Tenantid $tenantid
2325
$headers = @{ Authorization = "Bearer $($AccessToken.access_token)" }

Diff for: version_latest.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.1
1+
7.0.2

0 commit comments

Comments
 (0)