Why is variable not being populated with data from Get-AzADServicePrinciple?
This won't work because the Get-AzADServicePrincipal
is returning an object, and you need to identify which part of the object you want to write out to the console.
I would suggest selecting the specific values you are trying to write out, or just call the variable you are assigning the output to.
example:
Connect-AzAccount
$appName = "AzureADGuestLifecycleMgmt"
$svcPrinciple = Get-AzADServicePrincipal -SearchString $appName
$svcPrinciple