Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bmsimp authored Jan 20, 2025
2 parents a14f961 + 1313a50 commit 4cf21d2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Function Invoke-EditTransportRule {


$Params = @{
Identity = $request.query.guid
Identity = $request.query.guid ?? $request.body.guid
}

try {
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Invoke-RemoveTransportRule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Function Invoke-RemoveTransportRule {


$Params = @{
Identity = $request.query.guid
Identity = $request.query.guid ?? $request.body.guid
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Function Invoke-RemoveTransportRuleTemplate {
$User = $request.headers.'x-ms-client-principal'
Write-LogMessage -user $User -API $APINAME -message 'Accessed this API' -Sev 'Debug'

$ID = $request.query.id
$ID = $request.query.id ?? $request.body.id
try {
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'TransportTemplate' and RowKey eq '$id'"
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Test-CIPPAccessPermissions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function Test-CIPPAccessPermissions {
$Messages.Add('You have all the required permissions.') | Out-Null
}

$LastUpdate = $GraphPermissions.Timestamp
$LastUpdate = [DateTime]::SpecifyKind($GraphPermissions.Timestamp.DateTime, [DateTimeKind]::Utc)
$CpvTable = Get-CippTable -tablename 'cpvtenants'
$CpvRefresh = Get-CippAzDataTableEntity @CpvTable -Filter "PartitionKey eq 'Tenant'"
$TenantList = Get-Tenants -IncludeErrors | Where-Object { $_.customerId -ne $env:TenantID -and $_.Excluded -eq $false }
Expand Down
18 changes: 10 additions & 8 deletions Modules/CippExtensions/Public/PwPush/New-PwPushLink.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function New-PwPushLink {
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess)]
Param(
$Payload
)
$Table = Get-CIPPTable -TableName Extensionsconfig
$Configuration = ((Get-CIPPAzDataTableEntity @Table).config | ConvertFrom-Json).PWPush
if ($Configuration.Enabled) {
if ($Configuration.Enabled -eq $true) {
Set-PwPushConfig -Configuration $Configuration
$PushParams = @{
Payload = $Payload
Expand All @@ -14,15 +14,17 @@ function New-PwPushLink {
if ($Configuration.ExpireAfterViews) { $PushParams.ExpireAfterViews = $Configuration.ExpireAfterViews }
if ($Configuration.DeletableByViewer) { $PushParams.DeletableByViewer = $Configuration.DeletableByViewer }
try {
$Link = New-Push @PushParams | Select-Object Link, LinkRetrievalStep
if ($Configuration.RetrievalStep) {
$Link.Link = $Link.LinkRetrievalStep
if ($PSCmdlet.ShouldProcess('Create a new PwPush link')) {
$Link = New-Push @PushParams
if ($Configuration.RetrievalStep) {
return $Link.LinkRetrievalStep
}
return $Link.Link
}
$Link | Select-Object -ExpandProperty Link
} catch {
$LogData = [PSCustomObject]@{
'Response' = $Link
'Exception' = Get-CippException -Exception $_
'Response' = $Link
'Exception' = Get-CippException -Exception $_
}
Write-LogMessage -API PwPush -Message "Failed to create a new PwPush link: $($_.Exception.Message)" -Sev 'Error' -LogData $LogData
throw 'Failed to create a new PwPush link, check the log book for more details'
Expand Down

0 comments on commit 4cf21d2

Please sign in to comment.