Invoke-DevartFindInvalidObjects

Synopsis

Detects invalid objects.

Description

The cmdlet identifies invalid objects in multiple databases and analyzes them to generate reports on the results.

Syntax

Invoke-DevartFindInvalidObjects -Connection <object> [-Database <string>] [-Alldatabases <SwitchParameter>] [-Log <string>] [-Report <string>] [<CommonParameters>]

Parameters

-Connection

Specifies a connection to the server where you want to find invalid objects. You can provide one of the following options:

  • A DevartDatabaseConnectionInfo object, which contains detailed connection settings, produced by the New-DevartSqlDatabaseConnection cmdlet.
  • A connection string that defines how to connect to the database.
-Connection <object>
Property Default value
Required True
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-Database

Specifies one or more databases separated by commas where you want to find invalid objects. The option overrides the values specified in the connection parameter.

-Database <string>
Property Default value
Required False
Position Named
Accept pipeline input False
Accept wildcard characters False

-Alldatabases

Finds invalid objects for all non-system databases specified in the connection parameter.

-Alldatabases <SwitchParameter>
Property Default value
Required False
Position Named
Default value False
Accept pipeline input False
Accept wildcard characters False

-Log

Specifies a path to save a log file.

-Log <string>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-Report

Generates a report in a CSV file format. You need to specify a path to save the report file.

-Report <string>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

Common parameters

<CommonParameters>

This cmdlet supports these common parameters:

  • Verbose – Provides detailed output about the command operation.
  • Debug – Provides debugging information.
  • ErrorAction – Specifies how to respond to errors.
  • ErrorVariable – Stores error messages in a variable.
  • WarningAction – Specifies how to respond to warnings.
  • WarningVariable – Stores warning messages in a variable.
  • InformationAction – Specifies how informational messages are handled.
  • InformationVariable – Stores informational messages in a variable.
  • OutBuffer – Controls the number of objects buffered before output.
  • PipelineVariable – Stores the current pipeline object in a variable.
  • OutVariable – Stores output objects in a variable.

For more information, see About Common Parameters.

Output

System.Boolean (returns true on success and false otherwise)

System.Boolean returns:

  • true if the operation was successful.
  • false if the operation failed.

Example

Invoke-DevartFindInvalidObjects -Connection $connection -Database "AdventureWorks2025_Dev, AdventureWorks2025_Test"