Skip to content

Commit

Permalink
Merge pull request #8 from lwhitelock/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lwhitelock authored Nov 2, 2023
2 parents bb9844d + 294710f commit b4d67a9
Show file tree
Hide file tree
Showing 328 changed files with 112,722 additions and 1,235 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/dev_cippb2p4g.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippb2p4g

on:
push:
branches:
- dev
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root

jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippb2p4g'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C106B398356B4EFCB81F779ED5806A0D }}
2 changes: 1 addition & 1 deletion .github/workflows/dev_cipppwrro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
app-name: 'cipppwrro'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_7CFCA05390754624B5492AF7ECD3D826 }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9E109464904540339CA94F283ACE1312 }}
2 changes: 1 addition & 1 deletion Activity_AddOrUpdateTableRows/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $Table = Get-CippTable -tablename $TableName
foreach ($param in $TableParams.Entity) {
try {
#Sending each item indivually, if it fails, log an error.
Add-AzDataTableEntity @Table -Entity $param -Force
Add-CIPPAzDataTableEntity @Table -Entity $param -Force
}
catch {
Write-LogMessage -API 'Activity_AddOrUpdateTableRows' -message "Unable to write to '$($TableParams.TableName)' Using RowKey $($param.RowKey) table: $($_.Exception.Message)" -sev error
Expand Down
2 changes: 1 addition & 1 deletion Activity_GetAllTableRows/run.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param($name)

$Table = Get-CippTable -tablename $name
$Rows = Get-AzDataTableEntity @Table
$Rows = Get-CIPPAzDataTableEntity @Table

Write-Output $Rows
2 changes: 2 additions & 0 deletions AddAPDevice/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ $Result = try {
if ($groupname -in $CurrentStatus.items.id) { throw "This device batch name already exists. Please try with another name." }
$body = '{"batchId":"' + $($GroupName) + '","devices":' + $Devices + '}'
$GraphRequest = (New-GraphPostRequest -uri "https://api.partnercenter.microsoft.com/v1/customers/$TenantFilter/DeviceBatches" -body $body -scope 'https://api.partnercenter.microsoft.com/user_impersonation')
Write-Host ($GraphRequest | ConvertTo-Json)
Start-Sleep 5
$NewStatus = New-GraphgetRequest -uri "https://api.partnercenter.microsoft.com/v1/customers/$tenantfilter/DeviceBatches" -scope 'https://api.partnercenter.microsoft.com/user_impersonation'
Write-Host $($Newstatus | ConvertTo-Json)
if ($Newstatus.totalcount -eq $CurrentStatus.totalcount) { throw "We could not find the new autopilot device. Please check if your input is correct." }
Write-Host $CurrentStatus.Items
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APIName -tenant $($Request.body.TenantFilter) -message "Created Autopilot devices group. Group ID is $GroupName" -Sev "Info"
Expand Down
14 changes: 6 additions & 8 deletions AddAlert/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
"methods": ["get", "post"]
},
{
"type": "http",
"direction": "out",
"name": "Response"
},
{
"name": "starter",
"direction": "in",
"type": "durableClient"
"type": "queue",
"direction": "out",
"name": "Subscription",
"queueName": "AlertSubscriptions"
}
]
}
}
4 changes: 2 additions & 2 deletions AddAlert/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $Results = foreach ($Tenant in $tenants) {
}

$Table = get-cipptable -TableName 'SchedulerConfig'
Add-AzDataTableEntity @Table -Entity $CompleteObject -Force
Add-CIPPAzDataTableEntity @Table -Entity $CompleteObject -Force
}
$URL = ($request.headers.'x-ms-original-url').split('/api') | Select-Object -First 1
if ($Tenant -eq 'AllTenants') {
Expand All @@ -58,7 +58,7 @@ $Results = foreach ($Tenant in $tenants) {
EventType = $eventType
ExecutingUser = $Request.headers.'x-ms-client-principal'
}
New-CIPPGraphSubscription @params
Push-OutputBinding -Name Subscription -Value $Params
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions AddAlertSubscription_Queue/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scriptFile": "../Modules/CippEntryPoints/CippEntryPoints.psm1",
"entryPoint": "Receive-CippQueueTrigger",
"bindings": [
{
"name": "QueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "AlertSubscriptions"
}
]
}
2 changes: 1 addition & 1 deletion AddCATemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ try {
$JSON = ($JSON | ConvertTo-Json -Depth 100)
$Table = Get-CippTable -tablename 'templates'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$JSON"
RowKey = "$GUID"
PartitionKey = "CATemplate"
Expand Down
75 changes: 37 additions & 38 deletions AddChocoApp/Choco.app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"displayName": "",
"installCommandLine": "",
"uninstallCommandLine": "",
Expand All @@ -11,47 +10,48 @@
"fileName": "IntunePackage.intunewin",
"@odata.type": "#microsoft.graph.win32LobApp",
"applicableArchitectures": "x86, x64",

"installExperience": {
"runAsAccount": "user",
"deviceRestartBehavior": "allow",
"@odata.type": "microsoft.graph.win32LobAppInstallExperience"
},
"detectionRules": [
{
"@odata.type": "#microsoft.graph.win32LobAppFileSystemDetection",
"path": "%programfiles%\\7-zip",
"fileOrFolderName": "7z.exe",
"check32BitOn64System": false,
"detectionType": "exists" }
"@odata.type": "#microsoft.graph.win32LobAppFileSystemDetection",
"path": "%programfiles%\\7-zip",
"fileOrFolderName": "7z.exe",
"check32BitOn64System": false,
"detectionType": "exists"
}
],
"returncode": [
{
"returnCode": 0,
"type": "success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1707,
"type": "Success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1641,
"type": "hardReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1618,
"type": "retry",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 3010,
"type": "softReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
}
],
"returncode": [
{
"returnCode": 0,
"type": "success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1707,
"type": "Success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1641,
"type": "hardReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1618,
"type": "retry",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 3010,
"type": "softReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
}
],
"minimumNumberOfProcessors": "1",
"minimumFreeDiskSpaceInMB": "8",
"minimumCpuSpeedInMHz": "4",
Expand All @@ -60,7 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"


}
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
2 changes: 1 addition & 1 deletion AddChocoApp/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $Results = foreach ($Tenant in $tenants) {
} | ConvertTo-Json -Depth 15
$Table = Get-CippTable -tablename 'apps'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$CompleteObject"
RowKey = "$((New-Guid).GUID)"
PartitionKey = "apps"
Expand Down
2 changes: 1 addition & 1 deletion AddExConnectorTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ try {
$JSON = ($JSON | Select-Object @{n = 'name'; e = { $_.name } }, * | ConvertTo-Json -Depth 10)
$Table = Get-CippTable -tablename 'templates'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$json"
RowKey = "$GUID"
direction = $request.body.cippconnectortype
Expand Down
2 changes: 1 addition & 1 deletion AddGroupTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
} | ConvertTo-Json
$Table = Get-CippTable -tablename 'templates'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$object"
RowKey = "$GUID"
PartitionKey = "GroupTemplate"
Expand Down
4 changes: 2 additions & 2 deletions AddIntuneTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ try {
} | ConvertTo-Json
$Table = Get-CippTable -tablename 'templates'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$object"
RowKey = "$GUID"
PartitionKey = "IntuneTemplate"
Expand Down Expand Up @@ -99,7 +99,7 @@ try {
} | ConvertTo-Json
$Table = Get-CippTable -tablename 'templates'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$object"
RowKey = "$GUID"
PartitionKey = "IntuneTemplate"
Expand Down
3 changes: 2 additions & 1 deletion AddMSPApp/Immybot.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/automate.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/cwcommand.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/datto.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/huntress.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
2 changes: 1 addition & 1 deletion AddMSPApp/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $Results = foreach ($Tenant in $tenants) {
} | ConvertTo-Json -Depth 15
$Table = Get-CippTable -tablename 'apps'
$Table.Force = $true
Add-AzDataTableEntity @Table -Entity @{
Add-CIPPAzDataTableEntity @Table -Entity @{
JSON = "$CompleteObject"
RowKey = "$((New-Guid).GUID)"
PartitionKey = "apps"
Expand Down
3 changes: 2 additions & 1 deletion AddMSPApp/syncro.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
4 changes: 1 addition & 3 deletions AddPolicy/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ $results = foreach ($Tenant in $tenants) {
}
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($Tenant) -message "Added policy $($Displayname)" -Sev "Error"
if ($AssignTo) {
$AssignBody = if ($AssignTo -ne "AllDevicesAndUsers") { '{"assignments":[{"id":"","target":{"@odata.type":"#microsoft.graph.' + $($AssignTo) + 'AssignmentTarget"}}]}' } else { '{"assignments":[{"id":"","target":{"@odata.type":"#microsoft.graph.allDevicesAssignmentTarget"}},{"id":"","target":{"@odata.type":"#microsoft.graph.allLicensedUsersAssignmentTarget"}}]}' }
$assign = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL('$($CreateRequest.id)')/assign" -tenantid $tenant -type POST -body $AssignBody
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($Tenant) -message "Assigned policy $($Displayname) to $AssignTo" -Sev "Info"
Set-CIPPAssignedPolicy -GroupName $AssignTo -PolicyId $CreateRequest.id -Type $TemplateTypeURL -TenantFilter $tenant
}
"Successfully added policy for $($Tenant)"
}
Expand Down
36 changes: 18 additions & 18 deletions AddScheduledItems/function.json → AddScheduledItem/function.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
}
Loading

0 comments on commit b4d67a9

Please sign in to comment.