SSIS Powershell将结果传递给变量

时间:2018-11-30 15:58:11

标签: powershell ssis

我有下面的Powershell脚本,用于检查文件是否存在并被锁定。这是通过执行过程任务在SSIS中调用的。但是,我想将此结果作为“ True”或“ False”传递给SSIS中的变量(称为“ Log_Result”,然后可以将其用于优先约束。如何修改脚本以传递值)对变量是对还是错?

# checks if the file exists and then if the file is locked

$file = "\\xxxx\xxxx\xxxxxxx\test.log"
if (Test-Path -path $file)
{ 
    try { [IO.File]::OpenWrite($file).close();exit 0 } catch { exit 999}
}
else
{
    exit 999
}

0 个答案:

没有答案
相关问题