Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-TierZeroServicePrincipals -Token $MSGraphToken - Invalid arguments error #8

Closed
mpras01 opened this issue Feb 6, 2024 · 3 comments

Comments

@mpras01
Copy link

mpras01 commented Feb 6, 2024

Hi,
I am running into the following error every time i try to fetch Get-TierZeroServicePrincipals

Get-TierZeroServicePrincipals -Token $MSGraphToken
select : Property "principal" cannot be found.
At C:\Users\Downloads\BARK.ps1:8276 char:28

  • $PartnerTier2Support | select -expand principal | ?{$_.'@odata.ty ...
    
  •                        ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (@{@odata.contex...ystem.Object[]}:PSObject) [Select-Object], PSArgumentException
    • FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand
@doubley612
Copy link

Just add "-ErrorAction Ignore" after "select -expand principal"

@superpb9
Copy link

superpb9 commented Jun 4, 2024

Thanks. Got similar issues here after executing Get-EntraTierZeroServicePrincipals -Token XYZ ... I guess, it is because variable values of '$PrivAuthAdmins', '$PartnerTier2Support' are empty {} in the response ... Adding "-ErrorAction Ignore" does solve the issue for now but wondering maybe an if-else condition before trying to expand the principal property in future versions would also help ... cheers.

@andyrobbins
Copy link
Contributor

This is now fixed by #17 , thank you for opening this issue @mpras01 and for the helpful tip @doubley612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants