# 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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manuals.blusapphire.io/blugenie/full-function-list/out-datatable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
