RFC (Request for Comments) documents for community feedback on design changes and improvements to PowerShell ecosystem
Provides PowerShell language and debugging support for Visual Studio Code
Central repository for PowerShell Desired State Configuration (DSC) resources.
This is a known issue, its tricky because PSReadLine does not get constant updates on Window Change events in a cross platform way. Marking as bug and will explore possible solutions
Hi, my name is klawrawkz. I am fine, how are you?
I get a similar error. I have not been able to track down a theoretical cause yet. The exception comes and goes like Michelangelo; today it has come, has not gone, continues to blow up, and is a real hassle because VSCode | POSH "intellisense" gets hosed and the only solution is to do a "F1 | > Developer: Reload Window" to get it working again.
Here is the output from PowerShell Editor Services:
[Warn - 4:21:40 PM] OmniSharp.Extensions.LanguageServer.Server.Configuration.DidChangeConfigurationProvider: No ConfigurationItems have been defined, configuration won't surface any configuration from the client! | [Warn - 4:27:02 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 130 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 205 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 74 | [Warn - 4:27:12 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 130 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 205 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 74 | [Warn - 4:31:51 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 85 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 205 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 74 | [Warn - 4:45:10 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:45:22 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:45:27 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:45:27 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:46:57 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCodeActionHandler: textDocument/codeAction skipping diagnostic with empty Code field: PowerShell The '<' operator is reserved for future use. | [Warn - 4:47:08 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:47:32 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 | [Warn - 4:47:56 PM] Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Exception occurred while running handling completion request - System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PowerShell.EditorServices.Services.Symbols.AstOperations.GetCompletionsAsync(Ast scriptAst, Token[] currentTokens, Int32 fileOffset, IInternalPowerShellExecutionService executionService, ILogger logger, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\Symbols\Visitors\AstOperations.cs:line 141 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 257 at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\TextDocument\Handlers\CompletionHandler.cs:line 91 |
It is, the process object you get back from Start-Process
is very limited in what you can do as your user does not have permissions to work with that token.
The same .Net problem were mentioned as the background reason for the -Wait problem on the start-process, but that was solved, so why can these issues not be solved used the same (interrnal) technique?
Using Start-Process -Credential ... -Wait
was solved because internally it still had access to the full process token where it could do things like wait until it was done ("synchronization rights"). Unfortunately that full process token is discarded and dotnet has no way to say hey give me a System.Diagnostics.Process object from that process handle. It is forced to use [System.Diagnostics.Process]::GetProcessById($newProcId)
to get a new process object but now it's subject to the same access checks that user normally would have when inspecting other processes.
The ultimately fix is to stop doing the work manually in Start-Process
to spawn the new process and just use the dotnet API directly. This was not possible before as dotnet didn't expose all the options that pwsh has but with the merging off https://github.com/dotnet/runtime/pull/82662 it should now be possible to do so.
It's worth noting that from pwsh 7.3, when this started being build for .NET 7, I think Compress-Archive should have started applying some default permissions (defined here), and that does seem to have been my experience, tested in WSL2.
I do not agree that it is a duplicate. Perhaps the background reason is the same .Net issue but it are completely different powershell issues. The same .Net problem were mentioned as the background reason for the -Wait problem on the start-process, but that was solved, so why can these issues not be solved used the same (interrnal) technique?
Update CHANGELOG for v2023.3.2-preview
Bump version to v2023.3.2-preview
Update CHANGELOG for v3.8.3
Bump version to v3.8.3
Automated PR for new release!
Merge pull request #4461 from PowerShell/release
Release v2023.3.1-preview
Bump typescript from 4.9.5 to 5.0.2 (#4468)
Bumps typescript from 4.9.5 to 5.0.2.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump esbuild from 0.17.11 to 0.17.12 (#4467)
Bumps esbuild from 0.17.11 to 0.17.12.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump @typescript-eslint/eslint-plugin from 5.55.0 to 5.56.0 (#4465)
Bumps @typescript-eslint/eslint-plugin from 5.55.0 to 5.56.0.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Remove references to separate preview extension
Better validate version string in release tools
Remove preview
label from marketplace
We were using this as an easy way to determine if the version is a pre-release. However, the marketplace always looks a the latest version meaning it was placing a "preview" label and our preview icon on the webpage.
So we had to write a different way to determine if the extension is a pre-release.
Move version functions to separate module
So the GitHub module isn't required.
Split build and test CI so PowerShell Core can be used for the former
Since it's required in order to use our version tools.
Allow preview
suffix for PowerShellEditorServices too
Since I do actually plan to use it to preview a PSReadLine preview.
Address feedback
Merge pull request #4464 from PowerShell/andschwa/no-preview
Remove preview
label from marketplace
Bump @typescript-eslint/eslint-plugin from 5.56.0 to 5.57.0 (#4476)
Bumps @typescript-eslint/eslint-plugin from 5.56.0 to 5.57.0.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump esbuild from 0.17.12 to 0.17.14 (#4480)
Bumps esbuild from 0.17.12 to 0.17.14.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump @typescript-eslint/parser from 5.55.0 to 5.57.0 (#4477)
Bumps @typescript-eslint/parser from 5.55.0 to 5.57.0.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bump sinon from 15.0.2 to 15.0.3 (#4478)
Bumps sinon from 15.0.2 to 15.0.3.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Remove problematic [RepoNames]
PowerShell class (#4481)
It was admittedly over-engineered and caused problems since PowerShell classes aren't imported across modules.
Instead just use ValidateSet
directly wherever the command is either
use-facing or switches on the string directly.
Update CHANGELOG for v2023.3.2-preview
Bump version to v2023.3.2-preview
Automated PR for new release!
Update CHANGELOG for v3.8.3
Bump version to v3.8.3
Merge pull request #2007 from PowerShell/release
Release v3.8.2
Update build documentation to include platyPS requirement
Since it's always used post-build to generate the documentation, we have
a #requires
for it but forgot to add it to the documentation.
Also suppress stderr for sysctl when checking if macOS is an Intel or Arm processor. On the former, it doesn't know what field we're querying.
Bump Emacs version in GitHub action and install updated packages
Now using use-package
to better install them, and setting
load-prefer-newer
which was probably the bug.
Merge pull request #2008 from PowerShell/andschwa/x64-macOS
Update build documentation to include platyPS requirement
Remove problematic [RepoNames]
PowerShell class (#4481)
It was admittedly over-engineered and caused problems since PowerShell classes aren't imported across modules.
Instead just use ValidateSet
directly wherever the command is either
use-facing or switches on the string directly.
It was admittedly over-engineered and caused problems since PowerShell classes aren't imported across modules.
Instead just use ValidateSet
directly wherever the command is either use-facing or switches on the string directly.
Interestingly they have an AlcWrapper
in their source...but yeah I don't see it in use for Az.IotHub
.
@justcain-ok I'll be at PSConfEU this year if you happen to be there!
Sure looks to me like the Azure module developers implemented an AssemblyLoadContext for their Accounts
module...and nothing else, looking at this search: https://github.com/search?q=repo%3AAzure%2Fazure-powershell+AssemblyLoadContext+path%3A%2F%5Esrc%5C%2F%2F+language%3AC%23&type=code&l=C%23
I browsed through the Az.IotHub module's sources in that same repo and it sure enough depends on a conflicting version of Microsoft.Extensions.Logging.Abstractions.dll
, and does not have an ALC to isolate it 🥲
It was admittedly over-engineered and caused problems since PowerShell classes aren't imported across modules.
Instead just use ValidateSet
directly wherever the command is either use-facing or switches on the string directly.
Remove problematic [RepoNames]
PowerShell class
It was admittedly over-engineered and caused problems since PowerShell classes aren't imported across modules.
Instead just use ValidateSet
directly wherever the command is either
use-facing or switches on the string directly.