Skip to content

Copy-DbaAudit bug reported via email #2116

@potatoqualitee

Description

@potatoqualitee

Hey there,
You have a bug in your Copy-SqlAudit function. It reports "Cannot bind argument to parameter 'Path' because it is an empty string." when you are trying to copy an Audit that writes to the application log. It's the check on the file path that's failing so I wrote a fix for it if you're interested.

My new line is simply:
if (($audit.Filepath) -ne $null -AND $(Test-SqlPath -SqlServer $destserver -Path $audit.Filepath) -eq $false)

That's all the old variables so would need to be updated to using test-dbasqlpath -sqlilnstance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions