Gerenios / AADInternals

AADInternals PowerShell module for administering Azure AD and Office 365
http://aadinternals.com/aadinternals
MIT License
1.2k stars 210 forks source link

Incompatible parameter sets in Open-AADIntOffice365Portal #80

Open cnotin opened 6 months ago

cnotin commented 6 months ago

Let's try this example: https://github.com/Gerenios/AADInternals/blob/0fa2edf5676439cd3fe7c92ed8006b63f0be9632/FederatedIdentityTools.ps1#L539

which fails with this error:

PS > Open-AADIntOffice365Portal -ImmutableId "Ah2J42BsPUOBoUcsCYn7vA==" -Issuer "http://mysts.company.com/adfs/ls" -PfxFileName "MyCert.pfx" -PfxPassword "mypassword"
Open-AADIntOffice365Portal : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Open-AADIntOffice365Portal -ImmutableId "Ah2J42BsPUOBoUcsCYn7vA==" -I ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Open-AADIntOffice365Portal], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Open-AADIntOffice365Portal

I believe the issue comes from the fact that $Issuer was added in 0.9.3 to the UseAnySTS parameter set: https://github.com/Gerenios/AADInternals/commit/ff0d29fd77cbcb32ce2a1837a1d94d8be0be8466#diff-46d55b4251af89e9ccb6780ad126da4295e254438fa446fdc1fc791f2ce8e027R569 I think it's an error since -Issuer should be able to be used with other arguments to pass certif info