# Out-DataTable

﻿

### Out-DataTable <a href="#out-datatable" id="out-datatable"></a>

### SYNOPSIS <a href="#synopsis" id="synopsis"></a>

Creates a DataTable for an object

### SYNTAX <a href="#syntax" id="syntax"></a>

```
Out-DataTable [-InputObject] <PSObject[]> [-NonNullable <String[]>] [<CommonParameters>]
```

### DESCRIPTION <a href="#description" id="description"></a>

Creates a DataTable based on an object's properties.

### EXAMPLES <a href="#examples" id="examples"></a>

#### EXAMPLE 1 <a href="#example-1" id="example-1"></a>

```
$dt = Get-psdrive | Out-DataTable
```

```
# This example creates a DataTable from the properties of Get-psdrive and assigns output to $dt variable
```

#### EXAMPLE 2 <a href="#example-2" id="example-2"></a>

```
Get-Process | Select Name, CPU | Out-DataTable | Invoke-SQLBulkCopy -ServerInstance $SQLInstance -Database $Database -Table $SQLTable -force -verbose
```

```
# Get a list of processes and their CPU, create a datatable, bulk import that data
```

### PARAMETERS <a href="#parameters" id="parameters"></a>

#### InputObject <a href="#inputobject" id="inputobject"></a>

```
-InputObject <PSObject[]>
   One or more objects to convert into a DataTable
   
   Required?                    true
   Position?                    1
   Default value                
   Accept pipeline input?       true (ByValue)
   Accept wildcard characters?  false
```

#### NonNullable <a href="#nonnullable" id="nonnullable"></a>

```
-NonNullable <String[]>
   A list of columns to set disable AllowDBNull on
   
   Required?                    false
   Position?                    named
   Default value                @()
   Accept pipeline input?       false
   Accept wildcard characters?  false
```

#### CommonParameters <a href="#commonparameters" id="commonparameters"></a>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
