Skip to content

Commit 361f3e5

Browse files
authored
Merge pull request #593 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 1ab4a65 + 8804685 commit 361f3e5

31 files changed

+94990
-166
lines changed

Modules/CIPPCore/CippCore.psd1

50 Bytes
Binary file not shown.

Modules/CIPPCore/Public/Add-CIPPDelegatedPermission.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ function Add-CIPPDelegatedPermission {
6969
}
7070
}
7171

72-
$Translator = Get-Content '.\PermissionsTranslator.json' | ConvertFrom-Json
72+
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
73+
$Translator = Get-Content (Join-Path $ModuleBase 'lib\data\PermissionsTranslator.json') | ConvertFrom-Json
7374
$ServicePrincipalList = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/servicePrincipals?`$select=appId,id,displayName&`$top=999" -tenantid $TenantFilter -skipTokenCache $true -NoAuthCheck $true
7475
$ourSVCPrincipal = $ServicePrincipalList | Where-Object -Property appId -EQ $ApplicationId
7576
$Results = [System.Collections.Generic.List[string]]::new()

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecExchangeRoleRepair.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Invoke-ExecExchangeRoleRepair {
2222
Write-Information "Found $($RoleDefinitions.Count) Exchange role definitions"
2323

2424
$BasePath = Get-Module -Name 'CIPPCore' | Select-Object -ExpandProperty ModuleBase
25-
$AllOrgManagementRoles = Get-Content -Path "$BasePath\Public\OrganizationManagementRoles.json" -ErrorAction Stop | ConvertFrom-Json
25+
$AllOrgManagementRoles = Get-Content -Path "$BasePath\lib\data\OrganizationManagementRoles.json" -ErrorAction Stop | ConvertFrom-Json
2626

2727
$AvailableRoles = $RoleDefinitions | Where-Object -Property displayName -In $AllOrgManagementRoles | Select-Object -Property displayName, id, description
2828
Write-Information "Found $($AvailableRoles.Count) available Organization Management roles in Exchange"

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCreateSAMApp.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ function Invoke-ExecCreateSAMApp {
2424
$state = 'updated'
2525
#remove the entire web object from the app registration
2626
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
27-
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'Public\SAMManifest.json')
27+
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'lib\data\SAMManifest.json')
2828
$app = Get-Content $SamManifestFile.FullName | ConvertFrom-Json
2929
$app.web.redirectUris = @("$($url)/authredirect")
3030
$app = ConvertTo-Json -Depth 15 -Compress -InputObject $app
3131
Invoke-RestMethod "https://graph.microsoft.com/v1.0/applications/$($AppId.id)" -Headers @{ authorization = "Bearer $($Token.access_token)" } -Method PATCH -Body $app -ContentType 'application/json'
3232
} else {
3333
$state = 'created'
3434
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
35-
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'Public\SAMManifest.json')
35+
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'lib\data\SAMManifest.json')
3636
$app = Get-Content $SamManifestFile.FullName | ConvertFrom-Json
3737
$app.web.redirectUris = @("$($url)/authredirect")
3838
$app = $app | ConvertTo-Json -Depth 15

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecSAMSetup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function Invoke-ExecSAMSetup {
145145
if ($PartnerSetup) {
146146
#$app = Get-Content '.\Cache_SAMSetup\SAMManifest.json' | ConvertFrom-Json
147147
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
148-
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'Public\SAMManifest.json')
148+
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'lib\data\SAMManifest.json')
149149
$app = Get-Content $SamManifestFile.FullName | ConvertFrom-Json
150150

151151
$App.web.redirectUris = @($App.web.redirectUris + $URL)

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ListUsers.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Function Invoke-ListUsers {
77
#>
88
[CmdletBinding()]
99
param($Request, $TriggerMetadata)
10-
$ConvertTable = Import-Csv ConversionTable.csv | Sort-Object -Property 'guid' -Unique
10+
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
11+
$ConvertTable = Import-Csv (Join-Path $ModuleBase 'lib\data\ConversionTable.csv') | Sort-Object -Property 'guid' -Unique
1112
# Interact with query parameters or the body of the request.
1213
$TenantFilter = $Request.Query.tenantFilter
1314
$GraphFilter = $Request.Query.graphFilter

Modules/CIPPCore/Public/Get-CIPPLicenseOverview.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function Get-CIPPLicenseOverview {
5050
Tenant = $TenantFilter
5151
Licenses = $LicRequest
5252
}
53-
Set-Location (Get-Item $PSScriptRoot).FullName
54-
$ConvertTable = Import-Csv ConversionTable.csv
53+
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
54+
$ConvertTable = Import-Csv (Join-Path $ModuleBase 'lib\data\ConversionTable.csv')
5555
$LicenseTable = Get-CIPPTable -TableName ExcludedLicenses
5656
$ExcludedSkuList = Get-CIPPAzDataTableEntity @LicenseTable
5757

Modules/CIPPCore/Public/GraphHelper/Convert-SKUName.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function Convert-SKUname {
99
$ConvertTable
1010
)
1111
if (!$ConvertTable) {
12-
Set-Location (Get-Item $PSScriptRoot).Parent.FullName
13-
$ConvertTable = Import-Csv ConversionTable.csv
12+
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
13+
$ConvertTable = Import-Csv (Join-Path $ModuleBase 'lib\data\ConversionTable.csv')
1414
}
1515
if ($SkuName) { $ReturnedName = ($ConvertTable | Where-Object { $_.String_Id -eq $SkuName } | Select-Object -Last 1).'Product_Display_Name' }
1616
if ($SkuID) { $ReturnedName = ($ConvertTable | Where-Object { $_.guid -eq $SkuID } | Select-Object -Last 1).'Product_Display_Name' }

Modules/CIPPCore/Public/GraphHelper/Get-CippSamPermissions.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function Get-CippSamPermissions {
2525

2626
if (!$SavedOnly.IsPresent) {
2727
$ModuleBase = Get-Module -Name CIPPCore | Select-Object -ExpandProperty ModuleBase
28-
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'Public\SAMManifest.json')
29-
$AdditionalPermissions = Get-Item (Join-Path $ModuleBase 'Public\AdditionalPermissions.json')
28+
$SamManifestFile = Get-Item (Join-Path $ModuleBase 'lib\data\SAMManifest.json')
29+
$AdditionalPermissions = Get-Item (Join-Path $ModuleBase 'lib\data\AdditionalPermissions.json')
3030

3131
$ServicePrincipalList = New-GraphGetRequest -Uri 'https://graph.microsoft.com/beta/servicePrincipals?$top=999&$select=id,appId,displayName' -tenantid $env:TenantID -NoAuthCheck $true
3232
$SAMManifest = Get-Content -Path $SamManifestFile.FullName | ConvertFrom-Json

Modules/CIPPCore/Public/New-CIPPBackup.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ function New-CIPPBackup {
8888
}
8989
$Table = Get-CippTable -tablename 'ScheduledBackup'
9090
try {
91-
$null = Add-CIPPAzDataTableEntity @Table -entity $entity -Force
91+
measure-cipptask -TaskName 'ScheduledBackupStorage' -EventName 'CIPP.BackupCompleted' -Script {
92+
$null = Add-CIPPAzDataTableEntity @Table -entity $entity -Force
93+
}
9294
Write-LogMessage -headers $Headers -API $APINAME -message 'Created backup' -Sev 'Debug'
9395
$State = 'Backup finished successfully'
9496
} catch {

0 commit comments

Comments
 (0)