Question on the RespondTo-FlowApprovalRequest cmdlet. I am attempting to use this cmdlet to set the response of an approval request to rejected but it doesn't seem to be working.
I tried the Add-PowerAppsAccount cmdlet to connect as the approver who has the request and an admin with P2 license. In both cases the RespondTo-FlowApprovalRequest runs without error but the approval response does not change. Ideally we need the response to change and the Flow to move on to the next step. Is there a bug with this cmdlet or may be the usage is incorrect?
First, what version of the PowerShell cmdlets are you using? I just downloaded and isntalled version 1.0.7 and the cmdlet is now Approve-FlowApprovalRequest or Deny-FlowApprovalRequest. Try the most recent version of the cmdlets and see if they don't work better. You can get them using this command
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber -Force
I should also add that right now the cmdlets are only for use by App Makers and Admins. I'm not sure you'll be able to get them to work with an account that didn't create the Approval.
Thank you. I was able to install the latest module and can see these two cmdlets. Attempted to run the deny cmdlet as the account that created the approval request but it did not work. No errors as well when running it.
Was the approval addressed to the account you tried to run the Deny with?
The following worked for me if the approval was assigned to me. I haven't tried it with a different user. I'll try that next.
Add-PowerAppsAccount $approval = Get-FlowApprovalRequest Deny-FlowApprovalRequest -ApprovalId $approval.ApprovalId -ApprovalRequestId $approval.ApprovalRequestId -EnvironmentName $approval.EnvironmentName -Comments "Approval Denied"
Just tried it with a regular user and it seems to work there also if I log in as the user who needs to accept or reject the approval. The user is a maker, but didn't make this particular Flow.