2

I used this guide to run the following powershell in a SSIS Execute SQL Task:

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
    }
}

Unfortunately, the task does not respect the throw. It will simply move past it and consider the task successful. Any help would be appreciated.

1 Answer 1

0

You can set the property of the PowerShell Task: FailTaskIfReturnCodeIsNotSuccess to "true". Optionally, FailPackageOnFailure property can be set to "true" (depending on your requirements).

Fail task if return code not success

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.