You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PowerShell Integrated Console hangs and fails to open. I looked into session log and found following error:
2022-06-14 11:41:01.289 -07:00 [INF] highlight handler loaded 2022-06-14 11:41:01.664 -07:00 [WRN] No ConfigurationItems have been defined, configuration won't surface any configuration from the client! 2022-06-14 11:41:01.698 -07:00 [INF] Host starting 2022-06-14 11:41:02.401 -07:00 [INF] ReadLine overridden with 'Microsoft.PowerShell.EditorServices.Services.PowerShell.Console.PsrlReadLine' 2022-06-14 11:41:02.606 -07:00 [FTL] Failed to handle request workspace/didChangeConfiguration System.Management.Automation.CommandNotFoundException: The module 'Microsoft.PowerShell.Security' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'. ---> System.Management.Automation.CmdletInvocationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.InvalidOperationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspaceStateException: The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspacePoolStateException: Cannot perform the operation because the runspace pool is not in the 'Opened' state. The current state is 'Broken'. at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.AssertPoolIsOpen() at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput)
--- End of inner exception stack trace ---
at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput) at System.Management.Automation.PowerShell.BeginInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state) at System.Management.Automation.RemoteDiscoveryHelper.InvokeTopLevelPowerShell(PowerShell powerShell, PSCmdlet cmdlet, PSInvocationSettings invocationSettings, String errorMessageTemplate, CancellationToken cancellationToken)+MoveNext() at System.Management.Automation.RemoteDiscoveryHelper.EnumerateWithCatch[T](IEnumerable1 enumerable, Action1 exceptionHandler)+MoveNext() --- End of inner exception stack trace --- at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T]() at System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.SetCorrectExecutionPolicy(PowerShell pwsh, ILogger logger) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 141 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShell(HostStartupInfo hostStartupInfo, ReadLineProvider readLineProvider) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 960 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShellSession() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 458 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.Run() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 443 --- End of stack trace from previous location --- at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TryStartAsync(HostStartOptions startOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 251 at Microsoft.PowerShell.EditorServices.Handlers.PsesConfigurationHandler.Handle(DidChangeConfigurationParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Workspace\Handlers\ConfigurationHandler.cs:line 91 at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.g__InnerRoute|6_0(IServiceScopeFactory serviceScopeFactory, TDescriptor descriptor, Object params, CancellationToken token)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.RouteNotification(IRequestDescriptor1 descriptors, Notification notification, CancellationToken token)
at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass11_0.<b__3>d.MoveNext()
2022-06-14 11:41:03.402 -07:00 [INF] Unable to find PSSA settings file at 'c:\Users\shikechen\Desktop\Test\PSScriptAnalyzerSettings.psd1'. Loading default rules.
2022-06-14 11:41:03.402 -07:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules`
PowerShell Version
Name Value---- -----PSVersion 7.2.4PSEdition CoreGitCommitId 7.2.4OS Microsoft Windows 10.0.22000Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0
Open a folder contain .ps1 file.
Select PowerShell 7 for integrated console.
Integrated console hangs!
Visuals
No response
Logs
Editor Service Log:
2022-06-14 11:41:01.289 -07:00 [INF] highlight handler loaded 2022-06-14 11:41:01.664 -07:00 [WRN] No ConfigurationItems have been defined, configuration won't surface any configuration from the client! 2022-06-14 11:41:01.698 -07:00 [INF] Host starting 2022-06-14 11:41:02.401 -07:00 [INF] ReadLine overridden with 'Microsoft.PowerShell.EditorServices.Services.PowerShell.Console.PsrlReadLine' 2022-06-14 11:41:02.606 -07:00 [FTL] Failed to handle request workspace/didChangeConfiguration System.Management.Automation.CommandNotFoundException: The module 'Microsoft.PowerShell.Security' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'. ---> System.Management.Automation.CmdletInvocationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.InvalidOperationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspaceStateException: The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspacePoolStateException: Cannot perform the operation because the runspace pool is not in the 'Opened' state. The current state is 'Broken'. at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.AssertPoolIsOpen() at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput)
--- End of inner exception stack trace ---
at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput) at System.Management.Automation.PowerShell.BeginInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state) at System.Management.Automation.RemoteDiscoveryHelper.InvokeTopLevelPowerShell(PowerShell powerShell, PSCmdlet cmdlet, PSInvocationSettings invocationSettings, String errorMessageTemplate, CancellationToken cancellationToken)+MoveNext() at System.Management.Automation.RemoteDiscoveryHelper.EnumerateWithCatch[T](IEnumerable1 enumerable, Action1 exceptionHandler)+MoveNext() --- End of inner exception stack trace --- at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T]() at System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.SetCorrectExecutionPolicy(PowerShell pwsh, ILogger logger) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 141 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShell(HostStartupInfo hostStartupInfo, ReadLineProvider readLineProvider) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 960 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShellSession() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 458 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.Run() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 443 --- End of stack trace from previous location --- at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TryStartAsync(HostStartOptions startOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 251 at Microsoft.PowerShell.EditorServices.Handlers.PsesConfigurationHandler.Handle(DidChangeConfigurationParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Workspace\Handlers\ConfigurationHandler.cs:line 91 at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.g__InnerRoute|6_0(IServiceScopeFactory serviceScopeFactory, TDescriptor descriptor, Object params, CancellationToken token)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.RouteNotification(IRequestDescriptor1 descriptors, Notification notification, CancellationToken token)
at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass11_0.<b__3>d.MoveNext()
2022-06-14 11:41:03.402 -07:00 [INF] Unable to find PSSA settings file at 'c:\Users\shikechen\Desktop\Test\PSScriptAnalyzerSettings.psd1'. Loading default rules.
2022-06-14 11:41:03.402 -07:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules
`
vscode-powershell.log
`2022-06-14 11:40:58 a.m. [NORMAL] -
WARNING: In development mode but PowerShellEditorServices dev module path cannot be found (or has not been built yet): c:\Users\shikechen.vscode\extensions\PowerShellEditorServices\module
[FTL] Failed to handle request workspace/didChangeConfiguration System.Management.Automation.CommandNotFoundException: The module 'Microsoft.PowerShell.Security' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'. ---> System.Management.Automation.CmdletInvocationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.InvalidOperationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspaceStateException: The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspacePoolStateException: Cannot perform the operation because the runspace pool is not in the 'Opened' state. The current state is 'Broken'. at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.AssertPoolIsOpen() at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state
Prerequisites
Summary
PowerShell Integrated Console hangs and fails to open. I looked into session log and found following error:
2022-06-14 11:41:01.289 -07:00 [INF] highlight handler loaded 2022-06-14 11:41:01.664 -07:00 [WRN] No ConfigurationItems have been defined, configuration won't surface any configuration from the client! 2022-06-14 11:41:01.698 -07:00 [INF] Host starting 2022-06-14 11:41:02.401 -07:00 [INF] ReadLine overridden with 'Microsoft.PowerShell.EditorServices.Services.PowerShell.Console.PsrlReadLine' 2022-06-14 11:41:02.606 -07:00 [FTL] Failed to handle request workspace/didChangeConfiguration System.Management.Automation.CommandNotFoundException: The module 'Microsoft.PowerShell.Security' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'. ---> System.Management.Automation.CmdletInvocationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.InvalidOperationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspaceStateException: The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspacePoolStateException: Cannot perform the operation because the runspace pool is not in the 'Opened' state. The current state is 'Broken'. at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.AssertPoolIsOpen() at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection
1 asyncResultOutput)--- End of inner exception stack trace ---
at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection
1 input, PSDataCollection
1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput) at System.Management.Automation.PowerShell.BeginInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state) at System.Management.Automation.RemoteDiscoveryHelper.InvokeTopLevelPowerShell(PowerShell powerShell, PSCmdlet cmdlet, PSInvocationSettings invocationSettings, String errorMessageTemplate, CancellationToken cancellationToken)+MoveNext() at System.Management.Automation.RemoteDiscoveryHelper.EnumerateWithCatch[T](IEnumerable
1 enumerable, Action1 exceptionHandler)+MoveNext() --- End of inner exception stack trace --- at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection
1 output, PSInvocationSettings settings)at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList
1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T]() at System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection
1 output, PSInvocationSettings settings)at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList
1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.SetCorrectExecutionPolicy(PowerShell pwsh, ILogger logger) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 141 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShell(HostStartupInfo hostStartupInfo, ReadLineProvider readLineProvider) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 960 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShellSession() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 458 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.Run() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 443 --- End of stack trace from previous location --- at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TryStartAsync(HostStartOptions startOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 251 at Microsoft.PowerShell.EditorServices.Handlers.PsesConfigurationHandler.Handle(DidChangeConfigurationParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Workspace\Handlers\ConfigurationHandler.cs:line 91 at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.g__InnerRoute|6_0(IServiceScopeFactory serviceScopeFactory, TDescriptor descriptor, Object params, CancellationToken token)at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.RouteNotification(IRequestDescriptor
1 descriptors, Notification notification, CancellationToken token)at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass11_0.<b__3>d.MoveNext()
2022-06-14 11:41:03.402 -07:00 [INF] Unable to find PSSA settings file at 'c:\Users\shikechen\Desktop\Test\PSScriptAnalyzerSettings.psd1'. Loading default rules.
2022-06-14 11:41:03.402 -07:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules`
PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell v2022.5.1
Steps to Reproduce
Open a folder contain .ps1 file.
Select PowerShell 7 for integrated console.
Integrated console hangs!
Visuals
No response
Logs
Editor Service Log:
2022-06-14 11:41:01.289 -07:00 [INF] highlight handler loaded 2022-06-14 11:41:01.664 -07:00 [WRN] No ConfigurationItems have been defined, configuration won't surface any configuration from the client! 2022-06-14 11:41:01.698 -07:00 [INF] Host starting 2022-06-14 11:41:02.401 -07:00 [INF] ReadLine overridden with 'Microsoft.PowerShell.EditorServices.Services.PowerShell.Console.PsrlReadLine' 2022-06-14 11:41:02.606 -07:00 [FTL] Failed to handle request workspace/didChangeConfiguration System.Management.Automation.CommandNotFoundException: The module 'Microsoft.PowerShell.Security' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'. ---> System.Management.Automation.CmdletInvocationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.InvalidOperationException: Failure from remote command: Import-Module -Name 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1': The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspaceStateException: The runspace state is not valid for this operation. ---> System.Management.Automation.Runspaces.InvalidRunspacePoolStateException: Cannot perform the operation because the runspace pool is not in the 'Opened' state. The current state is 'Broken'. at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.AssertPoolIsOpen() at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection
1 asyncResultOutput)--- End of inner exception stack trace ---
at System.Management.Automation.PowerShell.CoreInvokeAsync[TInput,TOutput](PSDataCollection
1 input, PSDataCollection
1 output, PSInvocationSettings settings, AsyncCallback callback, Object state, PSDataCollection1 asyncResultOutput) at System.Management.Automation.PowerShell.BeginInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings, AsyncCallback callback, Object state) at System.Management.Automation.RemoteDiscoveryHelper.InvokeTopLevelPowerShell(PowerShell powerShell, PSCmdlet cmdlet, PSInvocationSettings invocationSettings, String errorMessageTemplate, CancellationToken cancellationToken)+MoveNext() at System.Management.Automation.RemoteDiscoveryHelper.EnumerateWithCatch[T](IEnumerable
1 enumerable, Action1 exceptionHandler)+MoveNext() --- End of inner exception stack trace --- at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection
1 output, PSInvocationSettings settings)at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList
1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T]() at System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception) --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection
1 output, PSInvocationSettings settings)at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList
1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.SetCorrectExecutionPolicy(PowerShell pwsh, ILogger logger) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 141 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShell(HostStartupInfo hostStartupInfo, ReadLineProvider readLineProvider) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 960 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.CreateInitialPowerShellSession() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 458 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.Run() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 443 --- End of stack trace from previous location --- at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TryStartAsync(HostStartOptions startOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 251 at Microsoft.PowerShell.EditorServices.Handlers.PsesConfigurationHandler.Handle(DidChangeConfigurationParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Workspace\Handlers\ConfigurationHandler.cs:line 91 at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.g__InnerRoute|6_0(IServiceScopeFactory serviceScopeFactory, TDescriptor descriptor, Object params, CancellationToken token)at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.RouteNotification(IRequestDescriptor
1 descriptors, Notification notification, CancellationToken token)at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass11_0.<b__3>d.MoveNext()
2022-06-14 11:41:03.402 -07:00 [INF] Unable to find PSSA settings file at 'c:\Users\shikechen\Desktop\Test\PSScriptAnalyzerSettings.psd1'. Loading default rules.
2022-06-14 11:41:03.402 -07:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules
`
vscode-powershell.log
`2022-06-14 11:40:58 a.m. [NORMAL] -
WARNING: In development mode but PowerShellEditorServices dev module path cannot be found (or has not been built yet): c:\Users\shikechen.vscode\extensions\PowerShellEditorServices\module
2022-06-14 11:40:58 a.m. [NORMAL] - Language server starting --
2022-06-14 11:40:58 a.m. [NORMAL] - PowerShell executable: C:\Program Files\PowerShell\7\pwsh.exe
2022-06-14 11:40:58 a.m. [NORMAL] - PowerShell args: -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.5.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2022.5.1 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\logs\1655232058-426bd241-664e-4cae-a3f1-f9f3321244461655232053805\EditorServices.log' -SessionDetailsPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\sessions\PSES-VSCode-3956-603766' -FeatureFlags @()
2022-06-14 11:40:58 a.m. [NORMAL] - pwsh.exe started.
2022-06-14 11:40:58 a.m. [NORMAL] - Waiting for session file
2022-06-14 11:40:58 a.m. [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.5.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2022.5.1 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\logs\1655232058-426bd241-664e-4cae-a3f1-f9f3321244461655232053805\EditorServices.log' -SessionDetailsPath 'c:\Users\shikechen.vscode\extensions\ms-vscode.powershell-2022.5.1\sessions\PSES-VSCode-3956-603766' -FeatureFlags @()
2022-06-14 11:41:00 a.m. [NORMAL] - Session file found
2022-06-14 11:41:00 a.m. [NORMAL] - Registering terminal close callback
2022-06-14 11:41:00 a.m. [NORMAL] - Registering terminal PID log callback
2022-06-14 11:41:00 a.m. [NORMAL] - pwsh.exe PID: 16168
2022-06-14 11:41:00 a.m. [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\.\pipe\PSES_r10cdtum.kmg","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\.\pipe\PSES_orcjs420.ism"}
2022-06-14 11:41:00 a.m. [NORMAL] - Connecting to language service on pipe \.\pipe\PSES_r10cdtum.kmg...
2022-06-14 11:41:00 a.m. [NORMAL] - Language server started.
2022-06-14 11:41:00 a.m. [NORMAL] - Language service connected.
`
The text was updated successfully, but these errors were encountered: