Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-SQLBackups -MaxSize bug #5125

Closed
JuleSQL opened this issue Feb 26, 2019 · 0 comments · Fixed by #5126
Closed

Test-SQLBackups -MaxSize bug #5125

JuleSQL opened this issue Feb 26, 2019 · 0 comments · Fixed by #5126

Comments

@JuleSQL
Copy link

JuleSQL commented Feb 26, 2019

This is part of the script I'm using:

        foreach ($Restore in $Restores) 
        {
            $source_server_name = $Restore.ConnectName
            Write-Output "$source_server_name"
            Test-DbaLastBackup -SqlInstance $source_server_name -Destination $TargetRestoreServer -DataDirectory D:\ -LogDirectory D:\ -NoCheck -MaxSize 5000 | Export-Csv D:\temp\Test-Restore.csv -NoTypeInformation | Out-File D:\temp\Test-Restore.txt
        }

This is the error message:

Test-SQLBackups : System.Management.Automation.RuntimeException: Could not compare "5000" to "727141.973632813 727141.973632813 727141.973632813 727141.973632813 727141.973632813 727141.973632813". Error: "Cannot convert the "System.Object[]" value of type 
"System.Object[]" to type "System.Int32"."
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at Test-DbaLastBackup<Process>(Closure , FunctionContext )
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
At C:\temp\TestBackup.ps1:106 char:1
+ Test-SQLBackups -AutomationServer $AutomationServer -RepositoryDB $Re ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-SQLBackups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant