Skip to content

Commit c48b62c

Browse files
authored
Merge pull request #413 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 091b973 + 2e14462 commit c48b62c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphRequest.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,13 @@ function Invoke-ListGraphRequest {
120120

121121
try {
122122
$Results = Get-GraphRequestList @GraphRequestParams
123-
if ($Results | Where-Object { $_.nextLink }) {
124-
Write-Host "NextLink: $($Results.nextLink | Where-Object { $_ } | Select-Object -Last 1)"
125-
if ($Request.Query.TenantFilter -ne 'AllTenants') {
123+
if ($Results | Where-Object { $_.PSObject.Properties.Name -contains 'nextLink' }) {
124+
if (![string]::IsNullOrEmpty($Results.nextLink) -and $Request.Query.TenantFilter -ne 'AllTenants') {
125+
Write-Host "NextLink: $($Results.nextLink | Where-Object { $_ } | Select-Object -Last 1)"
126126
$Metadata['nextLink'] = $Results.nextLink | Where-Object { $_ } | Select-Object -Last 1
127127
}
128128
# Remove nextLink trailing object only if it’s the last item
129-
if ($Results[-1].PSObject.Properties.Name -contains 'nextLink') {
130-
$Results = $Results | Select-Object -First ($Results.Count - 1)
131-
}
129+
$Results = $Results | Where-Object { $_.PSObject.Properties.Name -notcontains 'nextLink' }
132130
}
133131
if ($Request.Query.ListProperties) {
134132
$Columns = ($Results | Select-Object -First 1).PSObject.Properties.Name

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-CIPPStandardsRun.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ function Invoke-CIPPStandardsRun {
4747
return
4848
} else {
4949
Write-Information 'Classic Standards Run'
50-
$AllTasks = Get-CIPPStandards
50+
51+
$GetStandardParams = @{
52+
TenantFilter = $TenantFilter
53+
runManually = $runManually
54+
}
55+
56+
if ($TemplateID) {
57+
$GetStandardParams['TemplateId'] = $TemplateID
58+
}
59+
60+
$AllTasks = Get-CIPPStandards @GetStandardParams
5161

5262
if ($Force.IsPresent) {
5363
Write-Information 'Clearing Rerun Cache'

0 commit comments

Comments
 (0)