Skip to content

Commit 2e518e8

Browse files
authored
Sync change from source repository (#157)
1 parent fb6646e commit 2e518e8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

reference/docs-conceptual/PSScriptAnalyzer/Rules/UseOutputTypeCorrectly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ function Get-Foo
4545
Param(
4646
)
4747
48-
return "four"
48+
return 'four'
4949
}
5050
```

reference/docs-conceptual/PSScriptAnalyzer/Rules/UseUsingScopeModifierInNewRunspaces.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,40 @@ Within the ScriptBlock, instead of just using a variable from the parent scope,
3232
### Wrong
3333

3434
```powershell
35-
$var = "foo"
35+
$var = 'foo'
3636
1..2 | ForEach-Object -Parallel { $var }
3737
```
3838

3939
### Correct
4040

4141
```powershell
42-
$var = "foo"
42+
$var = 'foo'
4343
1..2 | ForEach-Object -Parallel { $using:var }
4444
```
4545

4646
## More correct examples
4747

4848
```powershell
49-
$bar = "bar"
50-
Invoke-Command -ComputerName "foo" -ScriptBlock { $using:bar }
49+
$bar = 'bar'
50+
Invoke-Command -ComputerName 'foo' -ScriptBlock { $using:bar }
5151
```
5252

5353
```powershell
54-
$bar = "bar"
55-
$s = New-PSSession -ComputerName "foo"
54+
$bar = 'bar'
55+
$s = New-PSSession -ComputerName 'foo'
5656
Invoke-Command -Session $s -ScriptBlock { $using:bar }
5757
```
5858

5959
```powershell
6060
# Remark: Workflow is supported on Windows PowerShell only
6161
Workflow {
62-
$foo = "foo"
62+
$foo = 'foo'
6363
InlineScript { $using:foo }
6464
}
6565
```
6666

6767
```powershell
68-
$foo = "foo"
68+
$foo = 'foo'
6969
Start-ThreadJob -ScriptBlock { $using:foo }
7070
Start-Job -ScriptBlock {$using:foo }
7171
```

0 commit comments

Comments
 (0)