File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,6 @@ Describe "UseUsingScopeModifierInNewRunspaces" {
146146 }
147147
148148 Context " Should not detect anything" {
149-
150149 It " should not emit anything for: <Description>" {
151150 [System.Array ] $warnings = Invoke-ScriptAnalyzer - ScriptDefinition $ScriptBlock - Settings $settings
152151 $warnings.Count | Should - Be 0
@@ -293,11 +292,25 @@ Describe "UseUsingScopeModifierInNewRunspaces" {
293292 }
294293 }'
295294 }
296- # Script block with variables in params(), issue #1504: https://github.com/PowerShell/PSScriptAnalyzer/issues/1504
295+ # ScriptBlock with variables in params(), issue #1504: https://github.com/PowerShell/PSScriptAnalyzer/issues/1504
296+ # # Microsoft.PowerShell.Core \ Start-Job
297297 @ {
298- Description = ' Does not throw when variable is defined inside params()'
298+ Description = ' Does not throw when variable is defined inside params() - Start-Job '
299299 ScriptBlock = ' {
300-
300+ Start-Job -ScriptBlock {
301+ Param($Foo)
302+ $Foo
303+ } -ArgumentList "Bar" | Receive-Job -Wait -AutoRemoveJob
304+ }'
305+ }
306+ # # Microsoft.PowerShell.ThreadJob \ Start-ThreadJob
307+ @ {
308+ Description = ' Does not throw when variable is defined inside params() - Start-Job'
309+ ScriptBlock = ' {
310+ Start-ThreadJob -ScriptBlock {
311+ Param($Foo)
312+ $Foo
313+ } -ArgumentList "Bar" | Receive-Job -Wait -AutoRemoveJob
301314 }'
302315 }
303316 )
You can’t perform that action at this time.
0 commit comments