Get-ClassificationColumnForFilter
Published 25 January 2022
Gets all columns matching the supplied Filter.
Syntax
Get-ClassificationColumnForFilter [[-Filter] <Filter>] [[-MaxNumberOfResults] <int>] [[-StartResultNumber] <int>] [<CommonParameters>]
Description
Gets all columns matching the supplied Filter.
Available Filter properties: Instances [StringPropertyFilter] Databases [StringPropertyFilter] TablesWithSchemas [StringPropertyFilter] Columns [StringPropertyFilter] Tags [TagsFilter] PredictedInformationTypes [StringPropertyFilter] ColumnDataTypes [StringPropertyFilter] EmptyTablesFilter [One of ('Require', 'Include', 'Exclude')] PrimaryKeyFilter [One of ('Require', 'Include', 'Exclude')] IdentityConstraintFilter [One of ('Require', 'Include', 'Exclude')] CompositeKeyFilter [One of ('Require', 'Include', 'Exclude')] ForeignKeyFilter [One of ('Require', 'Include', 'Exclude')] WithNoTags [Boolean] WithTagsApplied [Boolean]
Where a StringPropertyFilter has the options: Include [string[]] IncludePartial [string[]] Exclude [string[]] ExcludePartial [string[]]
And TagsFilter has: Include [hashtable e.g. @{ "Information Classification" = @("Confidential") }] Exclude [hashtable e.g. @{ "Information Classification" = @("Confidential") }]
And where: 'Include' = Do not apply any restrictions based on this filter (e.g. Include all tables including empty tables) 'Exclude' = Exclude items matching this filter (e.g. Don't include empty tables) 'Require' = Restrict to items that match this filter (e.g. only include empty tables)
Parameters
-Filter
<Filter>
{{ Fill Filter Description }}
Aliases | None |
Required? | false |
Position? | 1 |
Default Value | None |
Accept Pipeline Input | True (ByPropertyName) |
Accept Wildcard Characters | false |
-MaxNumberOfResults
<Int32>
Maximum Number Of Results Optional. The maximum number of results you would like returned in one go. Combine this with StartResultNumber to get a slice of columns.
Aliases | None |
Required? | false |
Position? | 2 |
Default Value | 0 |
Accept Pipeline Input | True (ByPropertyName) |
Accept Wildcard Characters | false |
-StartResultNumber
<Int32>
Start Result Number Optional. The start index of the matched column collection. See MaxNumberOfResults and the below example.
Aliases | None |
Required? | false |
Position? | 3 |
Default Value | 0 |
Accept Pipeline Input | True (ByPropertyName) |
Accept Wildcard Characters | false |
-ProgressAction
<ActionPreference>
{{ Fill ProgressAction Description }}
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
None.
You cannot pipe input to this cmdlet.
Return values
The output type is the type of the objects that the cmdlet emits.
-
An array of hashtables with the following properties:
- id: string
- columnName: string
- tableName: string
- schemaName: string
- description: string
- tags: An array of Tag
- freeTextAttributes: An array of FreeTextAttribute
- tableRowCount: long
- dataType: string
- databaseName: string
- instanceName: string
-
Tag: A hashtable with the following properties:
- id: string
- name: string
- categoryId: string
-
FreeTextAttribute: A hashtable with the following properties:
- attributeId: string
- freeText: string
-
ColumnData: A hashtable with the following properties:
- columnData: string
- confidence: int
Examples
-------------------------- EXAMPLE 1 --------------------------
$filter = New-ClassificationColumnFilter $filter.Instances.Include = @('sqlserver\2016') $filter.Databases.Include = @('WorldWideImporters') Get-ClassificationColumnForFilter -Filter $filter
Fetches all columns from instance "sqlserver\sql2016" database "WideWorldImporters".
-------------------------- EXAMPLE 2 --------------------------
$filter = New-ClassificationColumnFilter $filter.Instances.Include = @('sqlserver\2016', 'sqlserver\staging') $filter.Databases.IncludePartial = @('world') Get-ClassificationColumnForFilter -Filter $filter
Fetches all columns from all databases containing the term "world" (e.g. WideWorldImporters) on instances "sqlserver\prod" and "sqlserver\staging".
-------------------------- EXAMPLE 3 --------------------------
$filter = New-ClassificationColumnFilter $filter.Instances.Include = @('sqlserver\test') $filter.Columns.ExcludePartial=@('%ID') $filter.EmptyTablesFilter = 'Exclude' $filter.WithNoTags = $true Get-ClassificationColumnForFilter -Filter $filter
Fetches all columns from instance "sqlserver\test" that don't have a name ending with 'ID' that are not in empty tables but have no columns applied.
-------------------------- EXAMPLE 4 --------------------------
$filter = New-ClassificationColumnFilter $filter.WithNoTags = $true Get-ClassificationColumnForFilter -Filter $filter -StartResultNumber 100 -MaxNumberOfResults 25
Fetches up to 25 columns contained within empty tables from all registered databases and instances, ignoring the first 100 matched columns.