Skip to content

Commit 76e1bbf

Browse files
authored
Change double quotes to single in docs where possible (#1911)
1 parent a289e7f commit 76e1bbf

23 files changed

+59
-59
lines changed

docs/Rules/AlignAssignmentStatement.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ are aligned or not. Consider the following example in which the key value pairs
1919

2020
```powershell
2121
$hashtable = @{
22-
property1 = "value"
23-
anotherProperty = "another value"
22+
property1 = 'value'
23+
anotherProperty = 'another value'
2424
}
2525
```
2626

2727
Alignment in this case would look like the following.
2828

2929
```powershell
3030
$hashtable = @{
31-
property1 = "value"
32-
anotherProperty = "another value"
31+
property1 = 'value'
32+
anotherProperty = 'another value'
3333
}
3434
```
3535

docs/Rules/AvoidGlobalAliases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Use other scope modifiers for new aliases.
2828
### Wrong
2929

3030
```powershell
31-
New-Alias -Name Name -Value Value -Scope "Global"
31+
New-Alias -Name Name -Value Value -Scope Global
3232
```
3333

3434
### Correct

docs/Rules/AvoidInvokingEmptyMembers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Provide the requested members for a given type or class.
2323
### Wrong
2424

2525
```powershell
26-
$MyString = "abc"
26+
$MyString = 'abc'
2727
$MyString.('len'+'gth')
2828
```
2929

3030
### Correct
3131

3232
```powershell
33-
$MyString = "abc"
33+
$MyString = 'abc'
3434
$MyString.('length')
3535
```

docs/Rules/AvoidOverwritingBuiltInCmdlets.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ following your settings file.
2626
@{
2727
'Rules' = @{
2828
'PSAvoidOverwritingBuiltInCmdlets' = @{
29-
'PowerShellVersion' = @("core-6.1.0-windows")
29+
'PowerShellVersion' = @('core-6.1.0-windows')
3030
}
3131
}
3232
}
@@ -38,8 +38,8 @@ following your settings file.
3838

3939
The parameter `PowerShellVersion` is a list of allowlists that ship with PSScriptAnalyzer.
4040

41-
**Note**: The default value for `PowerShellVersion` is `"core-6.1.0-windows"` if PowerShell 6 or
42-
later is installed, and `"desktop-5.1.14393.206-windows"` if it is not.
41+
**Note**: The default value for `PowerShellVersion` is `core-6.1.0-windows` if PowerShell 6 or
42+
later is installed, and `desktop-5.1.14393.206-windows` if it is not.
4343

4444
Usually, patched versions of PowerShell have the same cmdlet data, therefore only settings of major
4545
and minor versions of PowerShell are supplied. One can also create a custom settings file as well

docs/Rules/AvoidShouldContinueWithoutForce.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Function Test-ShouldContinue
3333
$MyString = 'blah'
3434
)
3535
36-
if ($PsCmdlet.ShouldContinue("ShouldContinue Query", "ShouldContinue Caption"))
36+
if ($PsCmdlet.ShouldContinue('ShouldContinue Query', 'ShouldContinue Caption'))
3737
{
3838
...
3939
}
@@ -52,7 +52,7 @@ Function Test-ShouldContinue
5252
[Switch]$Force
5353
)
5454
55-
if ($Force -or $PsCmdlet.ShouldContinue("ShouldContinue Query", "ShouldContinue Caption"))
55+
if ($Force -or $PsCmdlet.ShouldContinue('ShouldContinue Query', 'ShouldContinue Caption'))
5656
{
5757
...
5858
}

docs/Rules/AvoidUsingComputerNameHardcoded.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Remove hard coded computer names.
2525
```powershell
2626
Function Invoke-MyRemoteCommand ()
2727
{
28-
Invoke-Command -Port 343 -ComputerName "hardcoderemotehostname"
28+
Invoke-Command -Port 343 -ComputerName hardcoderemotehostname
2929
}
3030
```
3131

@@ -45,7 +45,7 @@ Function Invoke-MyCommand ($ComputerName)
4545
```powershell
4646
Function Invoke-MyLocalCommand ()
4747
{
48-
Invoke-Command -Port 343 -ComputerName "hardcodelocalhostname"
48+
Invoke-Command -Port 343 -ComputerName 'hardcodelocalhostname'
4949
}
5050
```
5151

docs/Rules/AvoidUsingConvertToSecureStringWithPlainText.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ module from the PowerShell Gallery.
3030
### Wrong
3131

3232
```powershell
33-
$UserInput = Read-Host "Please enter your secure code"
33+
$UserInput = Read-Host 'Please enter your secure code'
3434
$EncryptedInput = ConvertTo-SecureString -String $UserInput -AsPlainText -Force
3535
```
3636

3737
### Correct
3838

3939
```powershell
40-
$SecureUserInput = Read-Host "Please enter your secure code" -AsSecureString
40+
$SecureUserInput = Read-Host 'Please enter your secure code' -AsSecureString
4141
$EncryptedInput = ConvertFrom-SecureString -String $SecureUserInput
4242
$SecureString = ConvertTo-SecureString -String $EncryptedInput
4343
```

docs/Rules/AvoidUsingEmptyCatchBlock.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ try
4141
}
4242
catch [DivideByZeroException]
4343
{
44-
Write-Error "DivideByZeroException"
44+
Write-Error 'DivideByZeroException'
4545
}
4646
4747
try
@@ -50,6 +50,6 @@ try
5050
}
5151
catch [DivideByZeroException]
5252
{
53-
throw "DivideByZeroException"
53+
throw 'DivideByZeroException'
5454
}
5555
```

docs/Rules/AvoidUsingInvokeExpression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Remove the use of `Invoke-Expression`.
2626
### Wrong
2727

2828
```powershell
29-
Invoke-Expression "Get-Process"
29+
Invoke-Expression 'Get-Process'
3030
```
3131

3232
### Correct

docs/Rules/AvoidUsingWMICmdlet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ Change to the equivalent CIM based cmdlet.
4848

4949
```powershell
5050
Get-WmiObject -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-WmiObject
51-
Invoke-WmiMethod -Class Win32_Process -Name "Create" -ArgumentList @{ CommandLine = "notepad.exe" }
51+
Invoke-WmiMethod -Class Win32_Process -Name 'Create' -ArgumentList @{ CommandLine = 'notepad.exe' }
5252
```
5353

5454
### Correct
5555

5656
```powershell
5757
Get-CimInstance -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-CIMInstance
58-
Invoke-CimMethod -ClassName Win32_Process -MethodName "Create" -Arguments @{ CommandLine = "notepad.exe" }
58+
Invoke-CimMethod -ClassName Win32_Process -MethodName 'Create' -Arguments @{ CommandLine = 'notepad.exe' }
5959
```

0 commit comments

Comments
 (0)