Using Remove-MailboxPermission as an example we need to add “-confirm $false” to suppress the Are you sure prompt.
Remove-MailboxPermission -Identity "Mailbox Name" -user [email protected] -AccessRights FullAccess -InheritanceType All -confirm:$false