Start-SCOMAgentMaintenanceMode should have -Force parameter
Agent -initiated maintenance mode https://docs.microsoft.com/en-us/system-center/scom/manage-maintenance-mode-overview?view=sc-om-2019#enable-from-target-system-1 is great, however as of now it still forces an answer in the console prompt - preventing the use from automated scripts that run on target systems. Adding a -Force parameter that skips the "are you sure?" check would be very welcome and trivial to implement, without us having to reverse and simulate the behaviour to reach the same effect.
Min Triv commented
Is there a way to force pass Yes to automate this fully. If not is there an alternate command to use?