你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzPurviewClassificationRule
创建或更新分类规则
语法
New-AzPurviewClassificationRule
-Endpoint <String>
-Name <String>
-Body <IClassificationRule>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新分类规则
示例
示例 1:创建自定义分类对象
$reg1 = New-AzPurviewRegexClassificationRulePatternObject -Pattern '^col1$'
$reg2 = New-AzPurviewRegexClassificationRulePatternObject -Pattern '^col2$'
$regexarr = @($reg1, $reg2)
$obj = New-AzPurviewCustomClassificationRuleObject -Kind 'Custom' -ClassificationName ClassificationRule4 -RuleStatus 'Enabled' -Description 'This is a rule2' -ColumnPattern $regexarr
New-AzPurviewClassificationRule -Endpoint https://parv-brs-2.purview.azure.com -ClassificationRuleName ClassificationRule5 -Body $obj
ClassificationAction : Keep
ClassificationName : ClassificationRule4
ColumnPattern : {{
"kind": "Regex",
"pattern": "^col1$"
}, {
"kind": "Regex",
"pattern": "^col2$"
}}
CreatedAt : 2/8/2022 10:04:55 PM
DataPattern : {}
Description : This is a rule2
Id : classificationrules/ClassificationRule5
Kind : Custom
LastModifiedAt : 2/14/2022 9:00:32 AM
MinimumPercentageMatch :
Name : ClassificationRule5
RuleStatus : Enabled
Version : 2
创建自定义分类对象,名为“ClassificationRule4”
参数
-Body
. 若要构造,请参阅 BODY 属性的 NOTES 部分并创建哈希表。
类型: | IClassificationRule |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Endpoint
purview 帐户的扫描终结点。 示例:https://{accountName}.purview.azure.com
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
.
类型: | String |
别名: | ClassificationRuleName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |