Trying to run exchange-specific commands in the windows powershell returns errors so to make the windows powershell aware of the exchange commands we need to add the appropriate snap in with:
Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin
That line can be added at the top of any scheduled task scripts.
exchange powershell scheduled tasks
import use exchange commands in windows powershell
add exchange to windows powershell
add exchange powershell to windows powershell