Out-DataTable
Creates a DataTable for an object
Out-DataTable [-InputObject] <PSObject[]> [-NonNullable <String[]>] [<CommonParameters>]
Creates a DataTable based on an object's properties.
$dt = Get-psdrive | Out-DataTable
# This example creates a DataTable from the properties of Get-psdrive and assigns output to $dt variable
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
-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 <String[]>
A list of columns to set disable AllowDBNull on
Required? false
Position? named
Default value @()
Accept pipeline input? false
Accept wildcard characters? false
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Last modified 1yr ago