From ea5e8fdd3b5a41e2afb12aa702eb5e48a91b436f Mon Sep 17 00:00:00 2001 From: Jatin Prajapati Date: Sun, 24 Nov 2024 09:36:41 +0530 Subject: [PATCH] Updated New-EdgeToken.ps1 to fix the user.json file path and EdgeUrl format issue --- local-containers/scripts/New-EdgeToken.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local-containers/scripts/New-EdgeToken.ps1 b/local-containers/scripts/New-EdgeToken.ps1 index f04b78a49..1940eafa0 100644 --- a/local-containers/scripts/New-EdgeToken.ps1 +++ b/local-containers/scripts/New-EdgeToken.ps1 @@ -7,8 +7,8 @@ param ( $ErrorActionPreference = "Stop" -$XmCloudDeployApi = (Get-Content "$PSScriptRoot\.sitecore\user.json" | ConvertFrom-Json).endpoints.xmCloud.host -$XmCloudDeployAccessToken = (Get-Content "$PSScriptRoot\.sitecore\user.json" | ConvertFrom-Json).endpoints.xmCloud.accessToken +$XmCloudDeployApi = (Get-Content "$PSScriptRoot\..\..\.sitecore\user.json" | ConvertFrom-Json).endpoints.xmCloud.host +$XmCloudDeployAccessToken = (Get-Content "$PSScriptRoot\..\..\.sitecore\user.json" | ConvertFrom-Json).endpoints.xmCloud.accessToken $Headers = @{"Authorization" = "Bearer $XmCloudDeployAccessToken" } $URL = @( @@ -19,7 +19,7 @@ $URL = @( $Response = Invoke-RestMethod ($URL -join '/') -Method 'GET' -Headers $Headers -Verbose $AccessToken = $Response.apiKey -$EdgeUrl = "$($Response.edgeUrl)/api/graphql/ide" +$EdgeUrl = "$($Response.edgeUrl)api/graphql/ide" Write-Host "Launching Edge GraphQL IDE" Write-Host "Add { ""X-GQL-Token"" : ""$AccessToken"" } to the HTTP HEADERS tab at the bottom-left of the screen to write queries against your content" Start-Process $EdgeUrl