I have a powershell script that runs a 32 bit com object so when I run it in Powershell 64x it fails but runs fine in 86x
When I run it in a Sql Server Agent job it has the same 64x failure.
Is there a way around this? Like SSIS packages?
You can directly invoke the 32-bit version of PowerShell by calling it through the WOW64 path:
%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
Using the -File command line argument you can pass the name of the script you would like to run.
来源:https://stackoverflow.com/questions/10253543/run-a-32-bit-powershell-script-on-sql-server-agent