@@ -5,12 +5,13 @@ This document contains troubleshooting steps for commonly reported issues when u
5
5
6
6
## How do I change the PowerShell version?
7
7
8
- Starting VS Code 1.65, extensions now use the [ language status item API] [ ]
9
- instead of manually adding a button to the status bar. That means the PowerShell icon
10
- button in the status bar now exists under the language status menu, which looks like:
11
- ` {} ` . You can then pin the icon back to the status bar by hovering over that menu and
12
- clicking the pin button. The PowerShell icon will show you the current session's version,
13
- and clicking it will let you change to another session.
8
+ Starting VS Code 1.65, extensions now use the [ language status item API] [ ] instead of
9
+ manually adding a button to the status bar. That means the PowerShell icon button in the
10
+ status bar now exists under the language status menu, which looks like: ` {} ` . You can then
11
+ pin the icon back to the status bar by hovering over that menu and clicking the pin
12
+ button. The PowerShell icon will show you the current session's version, and clicking it
13
+ will let you change to another session. The language status icon will only appear when the
14
+ active editor's language mode is PowerShell.
14
15
15
16
### Using Windows PowerShell 5.1
16
17
@@ -20,7 +21,7 @@ major versions behind and in maintenance mode, Windows PowerShell is missing man
20
21
bug fixes and APIs we use to make the extension experience great. So please, if you can,
21
22
use PowerShell Core. That said, when using Windows PowerShell on older versions of the
22
23
Windows operating system, if the extension is failing to start (e.g. [ #2571 ] [ ] ), try
23
- installing [ WMF 5.1] [ ] .
24
+ installing [ WMF 5.1] [ ] and [ .NET Framework 4.8 ] [ dotnet-framework ] .
24
25
25
26
## How do I debug my PowerShell script?
26
27
@@ -85,9 +86,9 @@ This will cause `-` to register as a word boundary, meaning for example on the `
85
86
86
87
PowerShell syntax highlighting is performed in combination by the [ PowerShell Extension] [ ]
87
88
(semantic highlighting) and [ Editor Syntax] [ ] . Syntax highlighting for VS Code, Atom,
88
- SublimeText and even GitHub is provided by the [ Editor Syntax] repository on GitHub.
89
+ SublimeText and even GitHub is provided by the [ Editor Syntax] [ ] repository on GitHub.
89
90
90
- We introduced [ Semantic Highlighting] [ ] in [ v2021.2.2] , a feature that applies tokenized
91
+ We introduced [ Semantic Highlighting] [ ] in [ v2021.2.2] [ ] , a feature that applies tokenized
91
92
colors at a layer above [ Editor Syntax] [ ] . However, after [ community feedback] [ #3221 ] and
92
93
multiple bug reports (including colors changing unexpectedly and [ randomly] [ #3295 ] ), we
93
94
have decided to disable it by default.
@@ -96,7 +97,7 @@ To enable semantic highlighting and use this "experimental" feature, set:
96
97
97
98
``` json
98
99
"[powershell]" : {
99
- "editor.semanticHighlighting.enabled" : false
100
+ "editor.semanticHighlighting.enabled" : true
100
101
}
101
102
```
102
103
@@ -110,7 +111,8 @@ issues there in [Editor Syntax][].
110
111
111
112
Due to a known issue in [ Electron] [ ] , windows spawned by VS Code (such as those for
112
113
` Get-Credential ` , ` Connect-MsolService ` , ` Connect-AzAccount ` , ` Connect-AzureAd ` , etc.) do
113
- not appear above VS Code.
114
+ not appear above VS Code. Use <kbd >Alt</kbd >+<kbd >Tab</kbd > on Windows or
115
+ <kbd >Cmd</kbd >+<kbd >Tab</kbd > on macOS to switch to the other window.
114
116
115
117
## Visual Studio Code is not working like the ISE
116
118
@@ -126,11 +128,12 @@ and you can ask for new features [in their repository](https://github.com/Micros
126
128
127
129
## Known issues in the extension
128
130
129
- * If you are running the preview version "PowerShell Preview" side-by-side with the stable
130
- version "PowerShell" you _ will_ experience performance and debug issues. This is
131
- expected until we adopt VS Code's extension channels in [ #3716 ] [ ] .
131
+ * "CorruptZip: end of central directory record signature not found" when installing the
132
+ extension, [ #4474 ] [ ] .
132
133
133
- * You MUST [ DISABLE] [ ] one of them.
134
+ * Unfortunately it appears that a common corporate VPN with a firewall by Palo Alto is
135
+ disrupting the download of the extension binary from the VS Code marketplace. Please
136
+ reach out to your network administrators about this.
134
137
135
138
* "The Language Service could not be started" but it does start with the x86 version of
136
139
PowerShell.
@@ -139,18 +142,29 @@ and you can ask for new features [in their repository](https://github.com/Micros
139
142
other privilege management software dramatically slow down the start up of Windows
140
143
PowerShell x64. Please give the privilege management software feedback.
141
144
142
- * Variable renaming doesn't work properly, [ #261 ] .
145
+ * ` Write-Output ` is broken in Windows PowerShell 5.1, [ #3991 ] [ ] .
146
+
147
+ * We seem to have recently narrowed this down! If ` Start-Transcript ` has been called
148
+ within the Extension Terminal, say in your PowerShell profile, this will eventually
149
+ cause output to no longer appear. Please try removing the call to ` Start-Transcript `
150
+ and restarting the extension. We are investigating a fix.
151
+
152
+ * Variable renaming doesn't work as expected, [ #261 ] [ ] .
143
153
144
154
* PowerShell's usage of [ dynamic scope] [ ] rather than [ lexical scope] [ ] makes it
145
155
[ formally undecidable] [ ] to statically rename variables correctly (the only way to
146
156
know for sure which ` $x ` s refer to the same variable is to run the PowerShell script).
147
157
However, like with many features, we attempt a best effort.
148
158
149
- * "Go to Definition" doesn't work through module imports , [ #499 ] .
159
+ * ` $PSScriptRoot ` is not populated when running a code block (via F8) , [ #633 ] [ ] .
150
160
151
- * Again this is a best-effort task.
161
+ * This is by design. The value of ` $PSScriptRoot ` is only populated by PowerShell when
162
+ the caller is a script. Since <kbd >F8</kbd > or "Run Selection" is essentially
163
+ copy-pasting the selection into the terminal, it's behavior is the same as if you the
164
+ user pasted it. That is, it's a block of code and not a script file, and therefore
165
+ there is no relevant context to populate ` $PSScriptRoot ` .
152
166
153
- * Completions don't cycle when <kbd >Tab</kbd > is pressed like in the ISE, [ #25 ] .
167
+ * Completions don't cycle when <kbd >Tab</kbd > is pressed like in the ISE, [ #25 ] [ ] .
154
168
155
169
* Use the tab completion settings recommended in the [ ISE compatibility doc] [ ] .
156
170
@@ -159,12 +173,6 @@ and you can ask for new features [in their repository](https://github.com/Micros
159
173
* Check that the dialog hasn't opened behind VS Code. This is a known issue in
160
174
[ Electron] [ ] , the framework used by VS Code.
161
175
162
- * PowerShell classes don't have proper reference / symbol support, [ #3 ] [ ] .
163
-
164
- * One of the blockers for this was that we still supported Windows PowerShell v3 and v4.
165
- However, we don't support v3 and v4 anymore so we can do this work but it's not on the
166
- roadmap at this time.
167
-
168
176
* Document formatting takes a long time, [ #984 ] [ ] .
169
177
170
178
* Document formatting is provided by [ PSScriptAnalyzer] [ ] , but there may be
@@ -231,7 +239,7 @@ To fix the issue, we need to be able to reproduce it. To do that, we need:
231
239
232
240
In some cases, a GIF of the issue occurring is also very helpful.
233
241
234
- When you open a new issue, the GitHub issue template will have sections to guide you
242
+ When you [ open a new issue] [ ] , the GitHub issue template will have sections to guide you
235
243
through providing all of this information as well as environment information discussed
236
244
below.
237
245
@@ -395,9 +403,6 @@ WSManStackVersion 3.0
395
403
[ PSScriptAnalyzer ] : https://github.com/PowerShell/PSScriptAnalyzer
396
404
397
405
[ Command Palette ] : https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
398
- [ Coordinated Vulnerability Disclosure ] : https://technet.microsoft.com/security/dn467923
399
- [ custom host ] : https://docs.microsoft.com/en-us/powershell/developer/hosting/custom-host-samples
400
- [ DISABLE ] : https://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension
401
406
[ dynamic scope ] : http://ig2600.blogspot.com/2010/01/powershell-is-dynamically-scoped-and.html
402
407
[ Electron ] : https://github.com/Microsoft/vscode/issues/42356
403
408
[ existing issues ] : https://github.com/PowerShell/vscode-powershell/issues
@@ -407,35 +412,28 @@ WSManStackVersion 3.0
407
412
[ lexical scope ] : https://stackoverflow.com/questions/1047454/what-is-lexical-scope
408
413
[ look there ] : https://github.com/PowerShell/PowerShellEditorServices/issues
409
414
[ more information ] : #providing-information-about-your-environment
410
- [ open an issue ] : https://github.com/PowerShell/vscode-powershell/issues/new/choose
411
- [ open a new issue ] : #opening-a-new-issue
415
+ [ open a new issue ] : https://github.com/PowerShell/vscode-powershell/issues/new/choose
412
416
[ open an issue there ] : https://github.com/PowerShell/PSScriptAnalyzer/issues/new/choose
413
417
[ PowerShell Core 7.2 ] : https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2
414
- [ Reporting Problems ] : ../README.md#reporting-problems
415
418
[ semantic highlighting ] : https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide
416
419
[ tackling an issue ] : ./development.md
417
420
[ v2021.2.2 ] : https://github.com/PowerShell/vscode-powershell/releases/tag/v2021.2.2
418
421
[ VS Code Settings ] : https://code.visualstudio.com/docs/getstarted/settings
419
- [ will break this compatibility ] : https://github.com/PowerShell/vscode-powershell/issues/1310
420
422
[ WMF 5.1 ] : https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/setup/install-configure
423
+ [ dotnet-framework ] : https://dotnet.microsoft.com/en-us/download/dotnet-framework
421
424
[ word separators ] : https://stackoverflow.com/questions/31632351/visual-studio-code-customizing-word-separators
422
425
[ Your installed PowerShell Extension version ] : https://code.visualstudio.com/docs/editor/extension-gallery#_list-installed-extensions
423
426
[ your PowerShell version table ] : http://www.powertheshell.com/topic/learnpowershell/firststeps/psversion/
424
427
[ Your VS Code version ] : https://code.visualstudio.com/docs/supporting/FAQ#_how-do-i-find-the-vs-code-version
425
428
426
- [ #3 ] : https://github.com/PowerShell/vscode-powershell/issues/3
427
429
[ #25 ] : https://github.com/PowerShell/vscode-powershell/issues/25
428
- [ #140 ] : https://github.com/PowerShell/vscode-powershell/issues/140
430
+ [ #4474 ] : https://github.com/PowerShell/vscode-powershell/issues/4474
431
+ [ #3991 ] : https://github.com/PowerShell/vscode-powershell/issues/3991
429
432
[ #261 ] : https://github.com/PowerShell/vscode-powershell/issues/261
430
433
[ #410 (comment) ] : https://github.com/PowerShell/vscode-powershell/issues/410#issuecomment-397531817
431
- [ #499 ] : https://github.com/PowerShell/vscode-powershell/issues/499
432
- [ #535 ] : https://github.com/PowerShell/vscode-powershell/issues/535
433
- [ #550 ] : https://github.com/PowerShell/vscode-powershell/issues/550
434
- [ #647 ] : https://github.com/PowerShell/vscode-powershell/issues/647
435
434
[ #984 ] : https://github.com/PowerShell/vscode-powershell/issues/984
436
435
[ #2571 ] : https://github.com/PowerShell/vscode-powershell/issues/2572
437
436
[ #3221 ] : https://github.com/PowerShell/vscode-powershell/issues/3221#issuecomment-810563456
438
437
[ #3295 ] : https://github.com/PowerShell/vscode-powershell/issues/3295
439
- [ #3378 ] : https://github.com/PowerShell/vscode-powershell/issues/3378
440
438
[ #3701 ] : https://github.com/PowerShell/vscode-powershell/issues/3701
441
- [ #3716 ] : https://github.com/PowerShell/vscode-powershell/issues/3716
439
+ [ #633 ] : https://github.com/PowerShell/vscode-powershell/issues/633
0 commit comments