We have a runbook executing in a Hybrid worker which gets a wait time out error on function using ExecuteNonQuery to call a stored procedure in SQL database. The stored procedure has a transaction statement that bulk copies file data into a table and runs in 1.5 minutes in SSMS. I have set the command timeout property to 600 which should be more than enough. Any ideas on why it is still timing out?
Invoke-SQLExecuteNonQuery -Connection $Connection -Query $Query -CommandTimeOut 600 -AsStoredProcedure -KeepSession | Out-Null