File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11using namespace System.Net
22
3- Function Invoke-AddPolicy {
3+ function Invoke-AddPolicy {
44 <#
55 . FUNCTIONALITY
66 Entrypoint
@@ -14,8 +14,8 @@ Function Invoke-AddPolicy {
1414 $Headers = $Request.Headers
1515 Write-LogMessage - headers $Headers - API $APIName - message ' Accessed this API' - Sev ' Debug'
1616
17- $Tenants = ( $Request.Body.tenantFilter.value )
18- if (' AllTenants' -in $Tenants ) { $Tenants = (Get-Tenants ).defaultDomainName }
17+ $Tenants = $Request.Body.tenantFilter.value ? $Request .Body.tenantFilter.value : $Request .Body.tenantFilter
18+ if (' AllTenants' -in $Tenants ) { $Tetnants = (Get-Tenants ).defaultDomainName }
1919 $displayname = $Request.Body.displayName
2020 $description = $Request.Body.Description
2121 $AssignTo = if ($Request.Body.AssignTo -ne ' on' ) { $Request.Body.AssignTo }
@@ -25,7 +25,7 @@ Function Invoke-AddPolicy {
2525
2626 $results = foreach ($Tenant in $tenants ) {
2727 if ($Request.Body.replacemap .$tenant ) {
28- ([pscustomobject ]$Request.Body.replacemap .$tenant ).psobject.properties | ForEach-Object { $RawJson = $RawJson -replace $_.name , $_.value }
28+ ([pscustomobject ]$Request.Body.replacemap .$tenant ).psobject.properties | ForEach-Object { $RawJson = $RawJson -replace $_.name , $_.value }
2929 }
3030 try {
3131 Write-Host ' Calling Adding policy'
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function Invoke-ExecGitHubAction {
2323 $SplatParams = $Parameters | Select-Object - ExcludeProperty Action, TenantFilter | ConvertTo-Json | ConvertFrom-Json - AsHashtable
2424
2525 $Table = Get-CIPPTable - TableName Extensionsconfig
26- $Configuration = ((Get-CIPPAzDataTableEntity @Table ).config | ConvertFrom-Json ).GitHub
26+ $Configuration = ((Get-CIPPAzDataTableEntity @Table ).config | ConvertFrom-Json - ErrorAction SilentlyContinue ).GitHub
2727
2828 if (! $Configuration.Enabled ) {
2929 $Response = Invoke-RestMethod - Uri ' https://cippy.azurewebsites.net/api/ExecGitHubAction' - Method POST - Body ($Parameters | ConvertTo-Json - Depth 10 ) - ContentType ' application/json'
You can’t perform that action at this time.
0 commit comments