【问题标题】:SSIS PowershellSSIS Powershell
【发布时间】:2017-10-01 10:03:39
【问题描述】:

我正在尝试使用以下参数通过 SSIS 运行以下 Poweshell 命令..

(get-content z:\2.html) | foreach-object {$_ -replace "><", ">`r`nE<"} | set-content z:\2.html

这在命令行中的 Powershell 中有效,但我无法让它在 SSIS 中工作。

我得到了错误

at "", The process exit code was "1" while the expected was "0".

在 SSIS 我有:

1. Created an "Execute process Task"
2. Pointed the Executable to system32\WIndowsPowershell .. etc
3. Added the argument as detailed above using a variable as the filename 

有什么想法吗?

【问题讨论】:

  • 为什么要在 SSIS 中运行 powershell 脚本? z:\2.html 的下一步是什么?
  • 我在包含表格的 HTML 文件中添加换行符。然后我阅读以从这些表中提取数据。换行后,我可以在脚本中执行此操作!

标签: sql-server powershell ssis


【解决方案1】:

好像语法应该是....

(get-content z:\3.html) | foreach-object {$_ -replace '><', '>`r`nE<'} | set-content z:\3.html

现在可以了!

【讨论】:

  • @MigueIH 请接受这个答案,即使它是你的,所以问题将被标记为已回答
猜你喜欢
  • 1970-01-01
  • 2012-03-10
  • 1970-01-01
  • 2011-06-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多