Skip to content

Commit 1402f46

Browse files
Add test
1 parent dc3376c commit 1402f46

File tree

2 files changed

+271
-0
lines changed

2 files changed

+271
-0
lines changed

test/Pester/ExportYamlCommandHelp.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,11 @@ Describe "Export-YamlCommandHelp tests" {
229229
$relatedLinks[$offset]['text'] | Should -Be $linktext
230230
$relatedLinks[$offset]['href'] | Should -Be $uri
231231
}
232+
233+
It 'Should preserve the related links text with single quote characters' {
234+
$cmd = Import-MarkdownCommandHelp -Path "$PSScriptRoot/assets/Remove-SqlSensitivityClassification.md"
235+
$yamlFile = $cmd | Export-YamlCommandHelp -outputfolder $TestDrive -Force
236+
(Import-YamlCommandHelp $yamlFile).RelatedLinks[0].LinkText | Should -Match "'"
237+
}
232238
}
233239
}
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
---
2+
external help file: Microsoft.SqlServer.Management.PSSnapins.dll-Help.xml
3+
Locale: en-US
4+
Module Name: SqlServer
5+
ms.date: 05/30/2025
6+
online version: https://learn.microsoft.com/powershell/module/sqlserver/remove-sqlsensitivityclassification
7+
schema: 2.0.0
8+
title: Remove-SqlSensitivityClassification
9+
---
10+
11+
# Remove-SqlSensitivityClassification
12+
13+
## SYNOPSIS
14+
Remove the sensitivity label and/or information type of columns in the database.
15+
16+
## SYNTAX
17+
18+
### ByContext (Default)
19+
20+
```
21+
Remove-SqlSensitivityClassification -ColumnName <String[]> [-SuppressProviderContextWarning]
22+
[<CommonParameters>]
23+
```
24+
25+
### ByConnectionString
26+
27+
```
28+
Remove-SqlSensitivityClassification -ColumnName <String[]> -ConnectionString <String>
29+
[<CommonParameters>]
30+
```
31+
32+
### ByConnectionParameters
33+
34+
```
35+
Remove-SqlSensitivityClassification -ColumnName <String[]> -ServerInstance <PSObject>
36+
-DatabaseName <String> [-Credential <PSCredential>] [<CommonParameters>]
37+
```
38+
39+
### ByPath
40+
41+
```
42+
Remove-SqlSensitivityClassification -ColumnName <String[]> -Path <String>
43+
[<CommonParameters>]
44+
```
45+
46+
### ByDBObject
47+
48+
```
49+
Remove-SqlSensitivityClassification -ColumnName <String[]> -InputObject <Database>
50+
[<CommonParameters>]
51+
```
52+
53+
## DESCRIPTION
54+
55+
The Remove-SqlSensitivityClassification cmdlet removes the sensitivity label and information type of
56+
columns in the database.
57+
58+
The sensitivity labels and information types of columns can be set using
59+
[SQL Server Management Studio (SSMS)](/sql/ssms/sql-server-management-studio-ssms) release 17.5 and
60+
above, or with the Set-SqlSensitivityClassification cmdlet.
61+
62+
The sensitivity labels and information types of columns can be viewed using
63+
[SQL Server Management Studio (SSMS)](/sql/ssms/sql-server-management-studio-ssms) release 17.5 and
64+
above, the
65+
[Extended Properties catalog view](/sql/relational-databases/security/sql-data-discovery-and-classification?view=sql-server-2017#subheading-3),
66+
or the **Get-SqlSensitivityClassification** cmdlet.
67+
68+
> `Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.`
69+
70+
## EXAMPLES
71+
72+
### Example 1: Remove sensitivity label and information type from a column using Windows authentication
73+
74+
```powershell
75+
PS C:\> Remove-SqlSensitivityClassification -ServerInstance "MyComputer\MainInstance" -Database "myDatabase" -ColumnName "Sales.Customers.email"
76+
```
77+
78+
Remove the sensitivity label and information type of column `Sales.Customers.email` in `myDatabase`.
79+
80+
### Example 2: Remove sensitivity label and information type from a column by providing a database path
81+
82+
```powershell
83+
PS C:\> Remove-SqlSensitivityClassification -Path "SQLSERVER:\SQL\MyComputer\MainInstance\Databases\MyDatabase" -ColumnName "Sales.Customers.email"
84+
```
85+
86+
Remove the sensitivity label and information type of column `Sales.Customers.email` in `MyDatabase`.
87+
88+
### Example 3: Remove sensitivity labels and information types on multiple columns using current path context
89+
90+
```powershell
91+
PS C:\> $columns = @("Sales.Customers.ip_address" , "Sales.Customers.email")
92+
PS C:\> Set-Location "SQLSERVER:\SQL\MyComputer\MainInstance\Databases\MyDatabase"
93+
PS SQLSERVER:\SQL\MyComputer\MainInstance> Remove-SqlSensitivityClassification -ColumnName $columns
94+
WARNING: Using provider context. Server = MyComputer, Database = MyDatabase.
95+
```
96+
97+
Remove the sensitivity labels and information types of columns `Sales.Customers.ip_address` and
98+
`Sales.Customers.email` in `MyDatabase`.
99+
100+
## PARAMETERS
101+
102+
### -ColumnName
103+
104+
Name(s) of columns for which information type and sensitivity label is fetched.
105+
106+
```yaml
107+
Type: String[]
108+
Parameter Sets: (All)
109+
Aliases: Column
110+
111+
Required: True
112+
Position: Named
113+
Default value: None
114+
Accept pipeline input: True (ByPropertyName)
115+
Accept wildcard characters: False
116+
```
117+
118+
### -ConnectionString
119+
120+
Specifies a connection string to connect to the database. If this parameter is present, other
121+
connection parameters will be ignored
122+
123+
```yaml
124+
Type: String
125+
Parameter Sets: ByConnectionString
126+
Aliases:
127+
128+
Required: True
129+
Position: Named
130+
Default value: None
131+
Accept pipeline input: False
132+
Accept wildcard characters: False
133+
```
134+
135+
### -Credential
136+
137+
Specifies a credential used to connect to the database.
138+
139+
```yaml
140+
Type: PSCredential
141+
Parameter Sets: ByConnectionParameters
142+
Aliases:
143+
144+
Required: False
145+
Position: Named
146+
Default value: None
147+
Accept pipeline input: False
148+
Accept wildcard characters: False
149+
```
150+
151+
### -DatabaseName
152+
153+
Specifies the name of a database. This cmdlet connects to this database in the instance that is
154+
specified in the ServerInstance parameter.
155+
156+
If the *DatabaseName* parameter is not specified, the database that is used depends on whether the
157+
current path specifies both the SQLSERVER:\SQL folder and a database name. If the path specifies
158+
both the SQL folder and a database name, this cmdlet connects to the database that is specified in
159+
the path.
160+
161+
```yaml
162+
Type: String
163+
Parameter Sets: ByConnectionParameters
164+
Aliases:
165+
166+
Required: True
167+
Position: Named
168+
Default value: None
169+
Accept pipeline input: False
170+
Accept wildcard characters: False
171+
```
172+
173+
### -InputObject
174+
175+
Specifies a SQL Server Management Object (SMO) that represent the database that this cmdlet uses.
176+
177+
```yaml
178+
Type: Database
179+
Parameter Sets: ByDBObject
180+
Aliases:
181+
182+
Required: True
183+
Position: Named
184+
Default value: None
185+
Accept pipeline input: True (ByValue)
186+
Accept wildcard characters: False
187+
```
188+
189+
### -Path
190+
191+
Specifies the path to the instance of SQL Server on which this cmdlet runs the operation. If you do
192+
not specify a value for this parameter, the cmdlet uses the current working ___location.
193+
194+
```yaml
195+
Type: String
196+
Parameter Sets: ByPath
197+
Aliases:
198+
199+
Required: True
200+
Position: Named
201+
Default value: None
202+
Accept pipeline input: False
203+
Accept wildcard characters: False
204+
```
205+
206+
### -ServerInstance
207+
208+
Specifies either the name of the server instance (a string) or SQL Server Management Objects (SMO)
209+
object that specifies the name of an instance of the Database Engine. For default instances, only
210+
specify the computer name: MyComputer. For named instances, use the format
211+
ComputerName\InstanceName.
212+
213+
```yaml
214+
Type: PSObject
215+
Parameter Sets: ByConnectionParameters
216+
Aliases:
217+
218+
Required: True
219+
Position: Named
220+
Default value: None
221+
Accept pipeline input: False
222+
Accept wildcard characters: False
223+
```
224+
225+
### -SuppressProviderContextWarning
226+
227+
Indicates that this cmdlet suppresses the warning that this cmdlet has used in the database context
228+
from the current SQLSERVER:\SQL path setting to establish the database context for the cmdlet.
229+
230+
```yaml
231+
Type: SwitchParameter
232+
Parameter Sets: ByContext
233+
Aliases:
234+
235+
Required: False
236+
Position: Named
237+
Default value: None
238+
Accept pipeline input: False
239+
Accept wildcard characters: False
240+
```
241+
242+
### CommonParameters
243+
244+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
245+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
246+
-WarningAction, and -WarningVariable. For more information, see
247+
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
248+
249+
## INPUTS
250+
251+
### System.String[]
252+
253+
### Microsoft.SqlServer.Management.Smo.Database
254+
255+
## OUTPUTS
256+
257+
### System.Object
258+
259+
## NOTES
260+
261+
## RELATED LINKS
262+
263+
[What's new in SSMS 17.5: Data Discovery and Classification](https://cloudblogs.microsoft.com/sqlserver/2018/02/20/whats-new-in-ssms-17-5-data-discovery-and-classification/)
264+
265+
[SQL Data Discovery and Classification](/sql/relational-databases/security/sql-data-discovery-and-classification)

0 commit comments

Comments
 (0)