File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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'
You can’t perform that action at this time.
0 commit comments