You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot reproduce.
Are you SURE the script is the one you put in the issue ? Asking because sometimes users will open issues with a "simplified" script version and the culprit is a more complicated original script rather than the simple one used for opening the issue.
Also:
does it happen when you don't pass the -Path ?
did you try, just for the sake of eliminating issues of variable scoping, naming the value you pass to -Path as a unique variable name, such as $thisIsTheTargetPath = "C:\Apps\Export-DbaInstance" ?
I haven't tried not passing -Path although I have updated my script to not use the variable name $Path as this may be causing the issue as it's the same name as the parameter?
The issue seems to be with the DBATools code after the parameter value is passed down to here:
Export-DbaSpConfigure : Cannot bind argument to parameter Path because it is an empty string.
At line:14464 char:17
Verified issue does not already exist?
Yes I did search
What error did you receive?
After calling Export-DbaInstance like:
#Create relevant path for .sql files
$Path = "C:\Apps\Export-DbaInstance"
if (-Not (Test-Path -Path $Path)) {
New-Item -ItemType Directory -Path $Path
}
#Export the .sql files
Try {
Export-DbaInstance -SQLInstance $SQLServer -Path $Path -ExcludePassword -Force -EnableException
}
Catch {
...
}
I intermittently receive the error:
Export-DbaSpConfigure : Cannot bind argument to parameter Path because it is an empty string.
At line:14464 char:17
This doesn't happen all the time and is run over 10's of servers and I cannot see the issue?
Any help appreciated.
Steps to Reproduce
#Create relevant path for .sql files
$Path = "C:\Apps\Export-DbaInstance"
if (-Not (Test-Path -Path $Path)) {
New-Item -ItemType Directory -Path $Path
}
#Export the .sql files
Try {
Export-DbaInstance -SQLInstance $SQLServer -Path $Path -ExcludePassword -Force -EnableException
}
Catch {
...
}
Please confirm that you are running the most recent version of dbatools
Version Name Repository Description
2.1.8 dbatools PSGallery The community module that enables SQL Server Pros to automate database development and server administration
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
Name Value
PSVersion 5.1.20348.2849
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2849
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server Edition and Build number
Microsoft SQL Server 2019 (RTM-CU29-GDR) (KB5046860) - 15.0.4410.1 (X64)
.NET Framework Version
.NET Framework 4.8.4770.0
The text was updated successfully, but these errors were encountered: