在SQL Server代理上运行32位Powershell脚本 [英] Run a 32 bit Powershell script on Sql Server Agent

查看:138
本文介绍了在SQL Server代理上运行32位Powershell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行32位com对象的powershell脚本,所以当我在Powershell 64x中运行它时,它会失败,但在86x中运行会很好。

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

在一个SQL Server Agent作业具有相同的64x失败。

When I run it in a Sql Server Agent job it has the same 64x failure.

有没有解决的办法?像SSIS包一样?

Is there a way around this? Like SSIS packages?

推荐答案

您可以通过WOW64路径直接调用32位版本的PowerShell:

You can directly invoke the 32-bit version of PowerShell by calling it through the WOW64 path:

%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

使用-File命令行参数,可以传递要运行的脚本的名称。

Using the -File command line argument you can pass the name of the script you would like to run.

这篇关于在SQL Server代理上运行32位Powershell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆