Skip to content

Commit

Permalink
fix repeated warning regarding conf client scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
jazuntee committed Jan 27, 2023
1 parent 7d88add commit 792a280
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/internal/Confirm-ModuleAuthentication.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ function Confirm-ModuleAuthentication {
}
}
else {
Write-Warning 'Using a confidential client is non-interactive and requires that the necessary scopes/permissions be added to the application or have permissions on-behalf-of a user.'
if (!$script:ConnectState.MsGraphToken) {
Write-Warning 'Using a confidential client is non-interactive and requires that the necessary scopes/permissions be added to the application or have permissions on-behalf-of a user.'
}
$Stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
try {
$MsGraphToken = Get-MsalToken -ConfidentialClientApplication $ClientApplication -Scopes ([IO.Path]::Combine($script:mapMgEnvironmentToMgEndpoint[$CloudEnvironment], '.default')) -CorrelationId $CorrelationId -Verbose:$false -ErrorAction Stop
Expand Down

0 comments on commit 792a280

Please sign in to comment.