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

查看:28
本文介绍了在 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 代理作业中运行它时,它具有相同的 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%syswow64WindowsPowerShellv1.0powershell.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天全站免登陆