I developed a PowerShell script that uses EXO V2 module. At the beggining, I connect to Exchange Online via:
Connect-ExchangeOnline -Credential $Credential
after my stuff is done, I'd like to disconnect from Exchange Online, but
Disconnect-ExchangeOnline
asks for confirmation. Also adding -Confirm switch seems not changing the behavior. I'd like to schedule the script, so confirmation is a problem. Is there any way to disconnect without confirmation ? Or can I simple not disconnect ? I found this possibility somewhere, but I've concerns regarding security issues when leaving an open connection.