I have an application that I use to run Exchange Powershell commands inside C# code like below. This is an example of the relevant lines I use to run the powershell command
If that command would normally prompt for confirmation then you will need to either:
-Confirm:$false
-Force
$ConfirmPreference = "None"