Skip to content

Test-SQLBackups -MaxSize bug #5125

Closed
@JuleSQL

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions