Skip to content

Commit 4c1e05c

Browse files
committed
Started writing new test
1 parent e1dc126 commit 4c1e05c

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

Tests/Rules/UseUsingScopeModifierInNewRunspaces.tests.ps1

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,20 +278,27 @@ Describe "UseUsingScopeModifierInNewRunspaces" {
278278
# Issue 1492: https://github.com/PowerShell/PSScriptAnalyzer/issues/1492
279279
@{
280280
Description = 'Does not throw when the same variable name is used in two different sessions'
281-
ScriptBlock = @'
282-
function Get-One{
283-
Invoke-Command -Session $sourceRemoteSession {
284-
$a = $sccmModule
285-
foo $a
286-
}
287-
}
288-
function Get-Two{
289-
Invoke-Command -Session $sourceRemoteSession {
290-
$a = $sccmModule
291-
foo $a
292-
}
293-
}
294-
'@
281+
ScriptBlock = '{
282+
function Get-One {
283+
Invoke-Command -Session -ScriptBlock $sourceRemoteSession {
284+
$a = $sccmModule
285+
foo $a
286+
}
287+
}
288+
function Get-Two {
289+
Invoke-Command -Session -ScriptBlock $sourceRemoteSession {
290+
$a = $sccmModule
291+
foo $a
292+
}
293+
}
294+
}'
295+
}
296+
# Script block with variables in params(), issue #1504: https://github.com/PowerShell/PSScriptAnalyzer/issues/1504
297+
@{
298+
Description = 'Does not throw when variable is defined inside params()'
299+
ScriptBlock = '{
300+
301+
}'
295302
}
296303
)
297304
}

0 commit comments

Comments
 (0)