File tree 1 file changed +2
-2
lines changed
src/PowerShellEditorServices/Services/Analysis
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ private Task<PowerShellResult> InvokePowerShellAsync(PSCommand command)
328
328
329
329
private PowerShellResult InvokePowerShell ( PSCommand command )
330
330
{
331
- using ( var powerShell = System . Management . Automation . PowerShell . Create ( ) )
331
+ using ( var powerShell = System . Management . Automation . PowerShell . Create ( RunspaceMode . NewRunspace ) )
332
332
{
333
333
powerShell . RunspacePool = _analysisRunspacePool ;
334
334
powerShell . Commands = command ;
@@ -443,7 +443,7 @@ private IEnumerable<string> GetPSScriptAnalyzerRules()
443
443
/// <returns>A runspace pool with PSScriptAnalyzer loaded for running script analysis tasks.</returns>
444
444
private static RunspacePool CreatePssaRunspacePool ( out PSModuleInfo pssaModuleInfo )
445
445
{
446
- using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
446
+ using ( var ps = System . Management . Automation . PowerShell . Create ( RunspaceMode . NewRunspace ) )
447
447
{
448
448
// Run `Get-Module -ListAvailable -Name "PSScriptAnalyzer"`
449
449
ps . AddCommand ( "Get-Module" )
You can’t perform that action at this time.
0 commit comments