在SSIS执行进程任务中捕获Powershell异常

时间:2017-05-23 17:35:07

标签: powershell ssis

我使用此guide在SSIS执行SQL任务中运行以下powershell:

param (
    [string]$path = ""
)

cls

$data = gc $path

foreach ($line in $data){

    "Processing: $($line.Substring(0,10))"

    if ($line.Length -ne 512){
        throw "Ragged File"
    }
    else {
        continue
    }
}

不幸的是,该任务不尊重throw。它将简单地移过它并认为任务成功。任何帮助,将不胜感激。

0 个答案:

没有答案
相关问题