question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Powershell Code Formatter not working

See original GitHub issue

System Details

System Details Output

PS C:\code\remote-vscode-workspace> & {"### VSCode version: $(code -v)"; "`n### VSCode extensions:`n$(code --list-extensions --show-versions | Out-String)"; "`n### PSES version: $($pseditor.EditorServicesVersion)"; "`n### PowerShell version:`n$($PSVersionTable | Out-String)"}
### VSCode version: 1.33.1 51b0b28134d51361cf996d2f0a1c698247aeabd8 x64

### VSCode extensions:
Kelvin.vscode-sshfs@1.16.1
ms-vscode.powershell@1.12.1


### PSES version: 1.12.1.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17134.590
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.590
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When I try to run the formatter on a .ps1 file, using either Alt-Shift-F or selecting format document from the command palette, I get the error message: “There is no formatter for “powershell”-files installed”

Expected Behaviour

I would expect the document to be formatted, I know I have some inconsistencies

Actual Behaviour

I get the error message: “There is no formatter for “powershell”-files installed” image

Attached Logs

Follow the instructions in the troubleshooting docs about capturing and sending logs. ps-ext-logs.zip

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
derekslenkcommented, May 28, 2019

The new remoting tools provided in Code Insiders fixes all of my issues

1reaction
derekslenkcommented, Apr 24, 2019

I may have just figured this out…it doesn’t work for files using the remote file system component of visual studio. It seems to work fine on files in a local directory (other files are using SSH FS)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Formatting no longer works · Issue #2543 · PowerShell/vscode ...
i have a hard time reading my own code when it's not formatted consistently. i spend almost all my time writing posh code...
Read more >
Powershell Format Document not working : r/vscode - Reddit
I have been using Visual Studio Code to help me code Powershell scripts. One of the features I loved was the Format Document...
Read more >
VSCode – PowerShell Formating - JordanTheITguy
While this post can't fix all of those it certainly can help solve a lot of the basic arguments including how to format...
Read more >
Configure settings to auto format PowerShell code - README
As you type and when you save PowerShell files, they are auto formatted. Also the Script Analyst is enabled.
Read more >
User settings not working for formatting PowerShell code
I'm saying formatOnType is not working with ignoreOneLineBlock . The point is that if (1) { 2 } + Enter doesn't format with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found