Open firthro opened 3 days ago
Thanks for your submission! The error suggests your filesystem is unavailable (access denied).
I cannot reproduce, works fine for me.
Hello
The root issue was a local security lockdown by the organisation. And this is now released it is working once more.
Thanks
From: Justin Grote @.> Sent: 19 November 2024 15:53 To: PowerShell/vscode-powershell @.> Cc: Firth, Robert @.>; Author @.> Subject: Re: [PowerShell/vscode-powershell] Can not run PowerShell code selection (f8) in Visual Studio (Issue #5097)
External Mail
Thanks for your submission! The error suggests your filesystem is unavailable (access denied).
I cannot reproduce, works fine for me. image.png (view on web)https://github.com/user-attachments/assets/481cfd73-d94a-4979-a4cf-935581f4b841
— Reply to this email directly, view it on GitHubhttps://github.com/PowerShell/vscode-powershell/issues/5097#issuecomment-2486095734, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGAUZQZPKA5R337UTDG54VD2BNNGBAVCNFSM6AAAAABSB4BAACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBWGA4TKNZTGQ. You are receiving this because you authored the thread.Message ID: @.**@.>> Please see our Privacy Policy to learn how we handle personal data – www.schroders.com/en/privacy-policy
Visit Schroders Talking Point for market news and expert views http://www.schroders.com/talkingpoint
This email is confidential and is for the addressee only. If it has been sent to you in error, please do not forward it or copy it or act on its contents, but report it to @.*** For important disclaimers and regulatory information, please refer to www.schroders.com (Privacy Statement; and Important Information).
Schroder Investment Management Limited is authorised and regulated by the Financial Conduct Authority (FCA reference number 119348). Registered in England and Wales under company number 1893220 with registered office address at 1 London Wall Place, London EC2Y 5AU. VAT identification number GB 243 8687 30.
This issue has been labeled as resolved, please verify the provided fix (or other reason).
Prerequisites
Summary
I am experiencing a problem running PowerShell code interactively through Visual Studio Code. write-host "hello world" f8/ Run Selection will launch a PowerShell Extension that never completes.
I can run in the terminal and via PowerShell directlly.
If you terminate the PowerShell Services Client, the long error below appears (put intto the logs)
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
Save HelloWolrld.ps1 file with write-host "hello"
Select the line and press f8 in Visual Studio
Visuals
Logs
System.Management.Automation.CmdletProviderInvocationException: Access is denied ---> System.UnauthorizedAccessException: Access is denied ---> System.ComponentModel.Win32Exception: Access is denied --- End of inner exception stack trace --- at System.Management.Automation.Utils.NativeFileExists(String path) at Microsoft.PowerShell.Commands.FileSystemProvider.GetFileSystemInfo(String path, Boolean& isContainer) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeThePath(String basepath, Stackd87.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.<MediatR-IRequestHandler<OmniSharp-Extensions-LanguageServer-Protocol-Models-InternalInitializeParams\,OmniSharp-Extensions-LanguageServer-Protocol-Models-InitializeResult>-Handle>d81.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipelined3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestPreProcessorBehavior`2.d 2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestPostProcessorBehaviord2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.d 2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestExceptionActionProcessorBehaviord2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<g InnerRoute|7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.d7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>cDisplayClass10_0.<b__5>d.MoveNext() | Method='initialize' RequestId='0'
[Warn - 11:22:47 AM] OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.Server.Messages.InternalError | @Request='OmniSharp.Extensions.JsonRpc.Server.Messages.InternalError'
[Error - 12:00:20 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 12:00:20 PM] Connection to PowerShell Editor Services (the Extension Terminal) was closed. See below prompt to restart!
[Error - 12:00:20 PM] PowerShell Editor Services Client client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
1 tokenizedPathStack) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeRelativePathHelper(String path, String basePath) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeRelativePath(String path, String basePath) at System.Management.Automation.SessionStateInternal.NormalizeRelativePath(ProviderInfo provider, String path, String basePath, CmdletProviderContext context) --- 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.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask
1.ExecuteNormally(CancellationToken cancellationToken) | [Error - 11:22:47 AM] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request initialize 0 - System.Management.Automation.CmdletProviderInvocationException: Access is denied ---> System.UnauthorizedAccessException: Access is denied ---> System.ComponentModel.Win32Exception: Access is denied --- End of inner exception stack trace --- at System.Management.Automation.Utils.NativeFileExists(String path) at Microsoft.PowerShell.Commands.FileSystemProvider.GetFileSystemInfo(String path, Boolean& isContainer) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeThePath(String basepath, Stack1 tokenizedPathStack) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeRelativePathHelper(String path, String basePath) at Microsoft.PowerShell.Commands.FileSystemProvider.NormalizeRelativePath(String path, String basePath) at System.Management.Automation.SessionStateInternal.NormalizeRelativePath(ProviderInfo provider, String path, String basePath, CmdletProviderContext context) --- 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.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask
1.ExecuteNormally(CancellationToken cancellationToken) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask1.Run(CancellationToken cancellationToken) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask
1.ExecuteSynchronously(CancellationToken executorCancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.2.<Handle>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline
2.2.<Handle>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.2.<Handle>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.