Search code examples
powershellscriptingx86taskscheduler

How to execute powershell(x86) with schedule task?


I am automating send mail with outlook. My script make var outlook with .application:

$Global:outlook = New-Object -comobject outlook.application

My problem is about Task Schedule, Outlook is x86 and only work in ISE(x86) so I need make Task Schedule invoke powershell(x86). How can I do?

Example about task schedule:

PowerShell -File "C:\Users\Victor\Script.ps1"

thanks for the help and sorry for my English.


Solution

  • Just call the x86 version of Powershell using %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe