0

Trying to export SQL Objects via DBAtools in Powershell.

 Get-DbaAgentJob -SqlInstance 'TestServer01' -Job 'mydatabase-daily-backup' | Export-DbaScript -FilePath C:\temp\mydatabase-daily-backup.sql

The same script working fine and exporting the job details.

But, not working on a few servers, and returns the below error/warning

WARNING: [06:05:42][Get-DbaAgentJob] Failure | The value's length for key 'Data Source' exceeds its limit of '128'.

2
  • I cannot reproduce your error. What version are you running? 1.1.6 works as expected.
    – Jim
    Commented Sep 13, 2023 at 19:23
  • This isn't an error, it's a warning. Use the -Verbose switch and it may tell you which job is throwing this warning, which will get you closer to finding the source.
    – alroc
    Commented Sep 17, 2023 at 13:30

1 Answer 1

0

I had same issue while executing dbatools Backup-dbaDatabase.

Fortunately, it was executing properly on my laptop but while I was executing it on the server it was failing with the same error you pointed out.

That's why it was easy for me to identify that it is PowerShell version that is not compatible with latest build of dbatools module.

So, upgrading PowerShell to latest version fixed the error.

Thanks!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.