Skip to content

Commit d44afe2

Browse files
authored
Merge branch 'KelvinTegelaar:master' into master
2 parents 814bce7 + d513da2 commit d44afe2

962 files changed

Lines changed: 29774 additions & 36844 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
insert_final_newline = true
8+
9+
[*.{ps1, psd1, psm1}]
10+
indent_size = 4
11+
end_of_line = crlf
12+
trim_trailing_whitespace = true
13+
14+
[*.json]
15+
indent_size = 2
16+
end_of_line = crlf
17+
trim_trailing_whitespace = true
18+
19+
[*.{md, txt}]
20+
end_of_line = crlf
21+
max_line_length = off
22+
trim_trailing_whitespace = false
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 - cippacnqv
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+
permissions:
19+
id-token: write #This is required for requesting the JWT
20+
21+
steps:
22+
- name: 'Checkout GitHub Action'
23+
uses: actions/checkout@v4
24+
25+
- name: Login to Azure
26+
uses: azure/login@v1
27+
with:
28+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6085081ED1124B799258E9FF743FF4B9 }}
29+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9BDB2DDBFAFA4BC19C20A58B204BFAF3 }}
30+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_02B5224812794971B05EDD557AF2B867 }}
31+
32+
- name: 'Run Azure Functions Action'
33+
uses: Azure/functions-action@v1
34+
id: fa
35+
with:
36+
app-name: 'cippacnqv'
37+
slot-name: 'Production'
38+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
39+
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Powershell project to Azure Function App - cippy6oom
4+
name: Build and deploy Powershell project to Azure Function App - cippckdtz
55

66
on:
77
push:
@@ -24,7 +24,7 @@ jobs:
2424
uses: Azure/functions-action@v1
2525
id: fa
2626
with:
27-
app-name: 'cippy6oom'
27+
app-name: 'cippckdtz'
2828
slot-name: 'Production'
2929
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_B9C635E19DF6459F8995BA602EFA638A }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_726578DA8A7243BF9D82FE123C2F6E7F }}
Lines changed: 30 additions & 0 deletions
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 - cippz6s4d
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: 'cippz6s4d'
28+
slot-name: 'Production'
29+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D27E7CF0887F4E4591F3957CCA96F0FD }}

Activity_AddOrUpdateTableRows/run.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ $TableName = ($TableParams.Context['TableName'])
33
$Table = Get-CippTable -tablename $TableName
44

55
foreach ($param in $TableParams.Entity) {
6-
try {
7-
#Sending each item indivually, if it fails, log an error.
8-
Add-CIPPAzDataTableEntity @Table -Entity $param -Force
9-
}
10-
catch {
11-
Write-LogMessage -API 'Activity_AddOrUpdateTableRows' -message "Unable to write to '$($TableParams.TableName)' Using RowKey $($param.RowKey) table: $($_.Exception.Message)" -sev error
12-
}
6+
try {
7+
#Sending each item indivually, if it fails, log an error.
8+
Add-CIPPAzDataTableEntity @Table -Entity $param -Force
9+
} catch {
10+
Write-LogMessage -API 'Activity_AddOrUpdateTableRows' -message "Unable to write to '$($TableParams.TableName)' Using RowKey $($param.RowKey)" -LogData (Get-CippException -Exception $_) -sev error
11+
}
1312
}

Applications_Orchestrator/run.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ try {
1717
$Outputs = Wait-ActivityFunction -Task $ParallelTasks
1818
Write-Host $Outputs
1919
}
20-
catch {
20+
catch {
2121
Write-Host "Applications_Orchestrator exception: $($_.Exception.Message)"
2222
}
2323
finally {

Applications_Upload/run.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
param($name)
22
$Table = Get-CippTable -tablename 'apps'
3-
$Filter = "PartitionKey eq 'apps' and RowKey eq '$name'"
3+
$Filter = "PartitionKey eq 'apps' and RowKey eq '$name'"
44
Set-Location (Get-Item $PSScriptRoot).Parent.FullName
55
$ChocoApp = (Get-CIPPAzDataTableEntity @Table -filter $Filter).JSON | ConvertFrom-Json
66
$intuneBody = $ChocoApp.IntuneBody
7-
$tenants = if ($chocoapp.Tenant -eq 'AllTenants') {
7+
$tenants = if ($chocoapp.Tenant -eq 'AllTenants') {
88
(Get-tenants).defaultDomainName
99
} else {
1010
$chocoapp.Tenant
11-
}
11+
}
1212
if ($chocoApp.type -eq 'MSPApp') {
1313
[xml]$Intunexml = Get-Content "AddMSPApp\$($ChocoApp.MSPAppName).app.xml"
1414
$intunewinFilesize = (Get-Item "AddMSPApp\$($ChocoApp.MSPAppName).intunewin")
@@ -25,7 +25,7 @@ $ContentBody = ConvertTo-Json @{
2525
name = $intunexml.ApplicationInfo.FileName
2626
size = [int64]$intunexml.ApplicationInfo.UnencryptedContentSize
2727
sizeEncrypted = [int64]($intunewinFilesize).length
28-
}
28+
}
2929
$ClearRow = Get-CIPPAzDataTableEntity @Table -Filter $Filter
3030
$RemoveCacheFile = if ($chocoapp.Tenant -ne 'AllTenants') {
3131
Remove-AzDataTableEntity @Table -Entity $clearRow
@@ -54,11 +54,11 @@ foreach ($tenant in $tenants) {
5454
Try {
5555

5656
$ApplicationList = (New-graphGetRequest -Uri $baseuri -tenantid $Tenant) | Where-Object { $_.DisplayName -eq $ChocoApp.ApplicationName }
57-
if ($ApplicationList.displayname.count -ge 1) {
57+
if ($ApplicationList.displayname.count -ge 1) {
5858
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message "$($ChocoApp.ApplicationName) exists. Skipping this application" -Sev 'Info'
5959
continue
6060
}
61-
if ($chocoApp.type -eq 'WinGet') {
61+
if ($chocoApp.type -eq 'WinGet') {
6262
Write-Host 'Winget!'
6363
Write-Host ($intuneBody | ConvertTo-Json -Compress)
6464
$NewApp = New-GraphPostRequest -Uri $baseuri -Body ($intuneBody | ConvertTo-Json -Compress) -Type POST -tenantid $tenant
@@ -79,8 +79,8 @@ foreach ($tenant in $tenants) {
7979
$AzFileUri = New-graphGetRequest -Uri "$($BaseURI)/$($NewApp.id)/microsoft.graph.win32lobapp/contentVersions/1/files/$($ContentReq.id)" -tenantid $tenant
8080
if ($AZfileuri.uploadState -like '*fail*') { break }
8181
Start-Sleep -Milliseconds 300
82-
} while ($AzFileUri.AzureStorageUri -eq $null)
83-
82+
} while ($AzFileUri.AzureStorageUri -eq $null)
83+
8484
$chunkSizeInBytes = 4mb
8585
[byte[]]$bytes = [System.IO.File]::ReadAllBytes($($intunewinFilesize.fullname))
8686
$chunks = [Math]::Ceiling($bytes.Length / $chunkSizeInBytes)
@@ -89,15 +89,15 @@ foreach ($tenant in $tenants) {
8989
$Upload = Invoke-RestMethod -Uri "$($AzFileUri.azureStorageUri)&comp=block&blockid=$id" -Method Put -Headers @{'x-ms-blob-type' = 'BlockBlob' } -InFile $inFile -ContentType 'application/octet-stream'
9090
$ConfirmUpload = Invoke-RestMethod -Uri "$($AzFileUri.azureStorageUri)&comp=blocklist" -Method Put -Body "<?xml version=`"1.0`" encoding=`"utf-8`"?><BlockList><Latest>$id</Latest></BlockList>"
9191
$CommitReq = New-graphPostRequest -Uri "$($BaseURI)/$($NewApp.id)/microsoft.graph.win32lobapp/contentVersions/1/files/$($ContentReq.id)/commit" -Body $EncBody -Type POST -tenantid $tenant
92-
92+
9393
do {
9494
$CommitStateReq = New-graphGetRequest -Uri "$($BaseURI)/$($NewApp.id)/microsoft.graph.win32lobapp/contentVersions/1/files/$($ContentReq.id)" -tenantid $tenant
9595
if ($CommitStateReq.uploadState -like '*fail*') {
9696
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message "$($ChocoApp.ApplicationName) Commit failed. Please check if app uploaded succesful" -Sev 'Warning'
97-
break
97+
break
9898
}
9999
Start-Sleep -Milliseconds 300
100-
} while ($CommitStateReq.uploadState -eq 'commitFilePending')
100+
} while ($CommitStateReq.uploadState -eq 'commitFilePending')
101101
$CommitFinalizeReq = New-graphPostRequest -Uri "$($BaseURI)/$($NewApp.id)" -tenantid $tenant -Body '{"@odata.type":"#microsoft.graph.win32lobapp","committedContentVersion":"1"}' -type PATCH
102102
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message "Added Application $($chocoApp.ApplicationName)" -Sev 'Info'
103103
if ($AssignTo -ne 'On') {
@@ -108,7 +108,7 @@ foreach ($tenant in $tenants) {
108108
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message 'Successfully added Application' -Sev 'Info'
109109
} catch {
110110
"Failed to add Application for $($Tenant): $($_.Exception.Message)"
111-
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message "Failed adding Application $($ChocoApp.ApplicationName). Error: $($_.Exception.Message)" -Sev 'Error'
111+
Write-LogMessage -api 'AppUpload' -tenant $($Tenant) -message "Failed adding Application $($ChocoApp.ApplicationName). Error: $($_.Exception.Message)" -LogData (Get-CippException -Exception $_) -Sev 'Error'
112112
continue
113113
}
114114

BestPracticeAnalyser_All/function.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

BestPracticeAnalyser_GetQueue/function.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

BestPracticeAnalyser_GetQueue/run.ps1

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)