< Back

Get-DbaRandomizedDataset

Mon Jan 13, 2020 11:29 am

NAME Get-DbaRandomizedDataset



SYNOPSIS

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





SYNTAX

Get-DbaRandomizedDataset [[-Template] <System.String[]>] [[-TemplateFile] <System.String[]>] [[-Rows] <Int>]

[[-Locale] <String>] [[-InputObject] <System.Object[]>] [-EnableException <Switch>] [<CommonParameters>]





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





PARAMETERS

-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-InputObject [<System.Object[]>]

Accepts piped input from Get-DbaRandomizedDatasetTemplate



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Locale [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Rows [<Int>]

Amount of rows to generate. Th default is 100.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Template [<System.String[]>]

The name of the template to use.

It will go through the default templates to see if it's present



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-TemplateFile [<System.String[]>]

File to use as a template



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: DataGeneration

Author: Sander Stad (@sqlstad, sqlstad.nl)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS

https://dbatools.io/Get-DbaRandomizedDataSet