Replies: 1 comment 2 replies
-
Run the real |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I am attempting and failing to Mock the below command. I would really appreciate some guidance. The command is pulling back a list of Azure AD Group Members, in particular, Service Principal members.
((Invoke-AzRestMethod -Uri "https://graph.microsoft.com/beta/groups/$($Group.id)/members").Content | ConvertFrom-Json).value | Select-Object -Property DisplayName, Id, @{label='OdataType';expression={$_.'@odata.type'}}
My Mock is as follows:
Mock -CommandName Invoke-AzRestMethod -MockWith {} -ModuleName MyModuleName -ParameterFilter {$Uri -eq "https://graph.microsoft.com/beta/groups/$($fakeAADGroup.id)/members"}
The error that I get back is:
ConvertFrom-Json : Cannot bind argument to parameter "InputObject" because it is null.
The error makes complete sense, it is expecting some input from the pipeline but I am unsure how I mock this required input data.
Beta Was this translation helpful? Give feedback.
All reactions