commands

^

Get-DbaRandomizedDataset

Author Sander Stad (@sqlstad, sqlstad.nl)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaRandomizedDataset on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaRandomizedDataset.

Synopsis

This function will generate a random data set based on a template

Description

Generates a random value based on a template. The templates standardized in the templates folder and can be used to generate a data set. There is also an option to point to a specific template

Syntax

Get-DbaRandomizedDataset
    [[-Template] <String[]>]
    [[-TemplateFile] <String[]>]
    [[-Rows] <Int32>]
    [[-Locale] <String>]
    [[-InputObject] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaRandomizedDataset -Template Personaldata

Generate a data set based on the default template PersonalData.

Example: 2
PS C:\> Get-DbaRandomizedDataset -Template Personaldata -Rows 10

Generate a data set based on the default template PersonalData with 10 rows

Example: 3
PS C:\> Get-DbaRandomizedDataset -TemplateFile C:\Dataset\FinancialData.json

Generates data set based on a template file in another directory

Example: 4
PS C:\> Get-DbaRandomizedDataset -Template Personaldata, FinancialData

Generates multiple data sets

Example: 5
PS C:\> Get-DbaRandomizedDatasetTemplate -Template PersonalData | Get-DbaRandomizedDataset

Pipe the templates from Get-DbaRandomizedDatasetTemplate to Get-DbaRandomizedDataset and generate the data set

Optional Parameters

-Template

The name of the template to use. It will go through the default templates to see if it's present

Alias
Required False
Pipeline false
Default Value
-TemplateFile

File to use as a template

Alias
Required False
Pipeline false
Default Value
-Rows

Amount of rows to generate. Th default is 100.

Alias
Required False
Pipeline false
Default Value 100
-Locale

Set the local to enable certain settings in the masking. The default is 'en'

Alias
Required False
Pipeline false
Default Value en
-InputObject

Accepts piped input from Get-DbaRandomizedDatasetTemplate

Alias
Required False
Pipeline true (ByValue)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False