diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index ed540c3ac714..90bacad53a71 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -95,6 +95,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Create version.json with version and commit hash + - name: Create version.json + run: | + VERSION=$(cat version_latest.txt | tr -d '[:space:]') + SHORT_SHA="${GITHUB_SHA::7}" + echo "{\"version\": \"${VERSION}\", \"commit\": \"${SHORT_SHA}\"}" > version.json + + - name: Build and stage modules + shell: pwsh + run: ./Tools/Build-DevApiModules.ps1 + # Create ZIP File in a New Source Directory - name: Prepare and Zip Release Files if: env.tag_exists == 'false' diff --git a/.github/workflows/upload_dev.yml b/.github/workflows/upload_dev.yml index f01108f3c68b..145ca2b8fcda 100644 --- a/.github/workflows/upload_dev.yml +++ b/.github/workflows/upload_dev.yml @@ -25,6 +25,10 @@ jobs: SHORT_SHA="${GITHUB_SHA::7}" echo "{\"version\": \"${VERSION}\", \"commit\": \"${SHORT_SHA}\"}" > version.json + - name: Build and stage modules + shell: pwsh + run: ./Tools/Build-DevApiModules.ps1 + # Create ZIP File in a New Source Directory - name: Prepare and Zip Release Files run: | diff --git a/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 b/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 index 22319472885f..b00000f7f90a 100644 --- a/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 +++ b/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 @@ -107,7 +107,7 @@ function New-GraphGetRequest { } else { if ($Data.PSObject.Properties.Name -contains 'value') { $data.value } else { $Data } if ($noPagination -eq $true) { - if ($Caller -eq 'Get-GraphRequestList') { + if ($Caller -eq 'Get-GraphRequestList' -and $data.'@odata.nextLink') { @{ 'nextLink' = $data.'@odata.nextLink' } } $nextURL = $null diff --git a/Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphRequest.ps1 b/Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphRequest.ps1 index 9f3335c108ed..aed9bf3143d8 100644 --- a/Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphRequest.ps1 +++ b/Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphRequest.ps1 @@ -159,9 +159,13 @@ function Invoke-ListGraphRequest { if ($NextLink -and $Request.Query.TenantFilter -ne 'AllTenants') { Write-Host "NextLink: $NextLink" $Metadata['nextLink'] = $NextLink + } else { + $Metadata.Remove('nextLink') } - # Remove nextLink trailing object only if it’s the last item + # Remove nextLink trailing object only if it's the last item $Results = $Results | Where-Object { $_.PSObject.Properties.Name -notcontains 'nextLink' } + } else { + $Metadata.Remove('nextLink') } if ($Request.Query.ListProperties) { $Columns = ($Results | Select-Object -First 1).PSObject.Properties.Name diff --git a/host.json b/host.json index 17268cf44dcc..e5c89cc14cb2 100644 --- a/host.json +++ b/host.json @@ -16,7 +16,7 @@ "distributedTracingEnabled": false, "version": "None" }, - "defaultVersion": "10.3.1", + "defaultVersion": "10.4.1", "versionMatchStrategy": "Strict", "versionFailureStrategy": "Fail" } diff --git a/version_latest.txt b/version_latest.txt index 816c0711afb0..da772b97257f 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -10.4.0 +10.4.1