2017-05-03 50 views
0

我嘗試使用下面的參數運行通過SSIS以下Poweshell命令..SSIS PowerShell的

(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 

任何想法?

+0

爲什麼要在SSIS中運行powershell腳本? z:\ 2.html的下一步是什麼? –

+0

我在包含表格的HTML文件中添加換行符。然後我讀取從這些表中提取數據。一旦我有換行符,我可以在腳本中執行此操作! – MiguelH

回答

0

好像語法應該是....

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

現在的工作!

+0

@MigueIH請接受這個答案,即使它是你的,所以問題將被標記爲回答 – Hadi