Get-SqlDataFile

Gets an SMO DataFile object.

Syntax

Get-SqlDataFile [-database] <Database> [<CommonParameters>]

Detailed Description

The Get-SqlDataFile function gets a collection of SMO DataFile objects for the database.

Related Commands

* Get-SqlDataFile

Parameters

Name Description Required? Pipeline Input Default Value
database    true  true (ByValue)   

Input Type

Microsoft.SqlServer.Management.Smo.Database You can pipe SMO database objects to Get-SqlDataFile

Return Values

Microsoft.SqlServer.Management.Smo.DataFile Get-SqlDataFile returns a Microsoft.SqlServer.Management.Smo.DataFile object.

Notes

Additional properties including the database, server and extended properties are included in the output.

Examples

EXAMPLE 1

Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlDataFile
This command gets a collection of SMO DataFile objects for all data files in the pubs database.