3
3
This document contains troubleshooting steps for commonly reported issues when using the
4
4
[ PowerShell Extension] for Visual Studio Code.
5
5
6
- ## Script Analysis is Reporting False Errors
6
+ ## How do I debug my PowerShell script?
7
7
8
- Script analysis is provided by the [ PSScriptAnalyzer] project on GitHub.
9
- Please [ open an issue there] if you are getting fault script diagnostics
10
- (red and green squiggly lines under PowerShell in scripts).
8
+ This topic is best covered in the "Debugging PowerShell Script in Visual Studio Code"
9
+ Scripting Guys blog posts (thanks community!):
11
10
12
- ## Problems with Syntax Highlighting
11
+ * [ Part 1] ( https://blogs.technet.microsoft.com/heyscriptingguy/2017/02/06/debugging-powershell-script-in-visual-studio-code-part-1/ )
12
+ * [ Part 2] ( https://blogs.technet.microsoft.com/heyscriptingguy/2017/02/13/debugging-powershell-script-in-visual-studio-code-part-2/ )
13
13
14
- PowerShell syntax highlighting is not performed by the [ PowerShell Extension] .
15
- Instead syntax highlighting for VSCode, Atom, SublimeText and even GitHub is
16
- provided by the [ Editor Syntax] repository on GitHub. Please open any
17
- [ syntax highlighting issues there] .
14
+ ## Script analysis is reporting false errors
18
15
19
- However, with the introduction of [ Semantic Highlighting] in [ v2021.2.2] , the
20
- chosen colors may be different because this is applied at a layer above [ Editor
21
- Syntax] . To disable semantic highlighting and so restore the colors as they
22
- were, set:
16
+ Script analysis is provided by the [ PSScriptAnalyzer] project on GitHub. If the warning
17
+ message starts with ` [PSScriptAnalyzer] ` or if you are getting faulty script diagnostics
18
+ (red and green squiggly lines under PowerShell in scripts) please [ open an issue there] .
19
+
20
+ ## Problems with syntax highlighting
21
+
22
+ PowerShell syntax highlighting is performed in combintation by the [ PowerShell Extension]
23
+ (semantic highlighting) and [ Editor Syntax] . Syntax highlighting for VS Code, Atom,
24
+ SublimeText and even GitHub is provided by the [ Editor Syntax] repository on GitHub.
25
+
26
+ With the introduction of [ Semantic Highlighting] in [ v2021.2.2] , the chosen colors may be
27
+ different because this is applied at a layer above [ Editor Syntax] . To disable semantic
28
+ highlighting and so restore the colors as they were and rely solely on [ Editor Syntax] ,
29
+ set:
23
30
24
31
``` json
25
32
"[powershell]" : {
@@ -30,7 +37,16 @@ were, set:
30
37
If you leave it enabled, you can customize the colors used for the various
31
38
tokens. See [ #3221 ] for more info and to leave suggestions.
32
39
33
- ## VSCode is not working like the ISE
40
+ If you disable it and your issue remains, then please open those [ syntax highlighting
41
+ issues there] .
42
+
43
+ ## Windows aren't appearing
44
+
45
+ Due to an [ issue] ( https://github.com/Microsoft/vscode/issues/42356 ) in Electron, windows
46
+ spawned by Visual Studio Code (such as those for ` Get-Credential ` , ` Connect-MsolService ` ,
47
+ ` Connect-AzAccount ` , ` Connect-AzureAd ` , etc.) do not appear above Visual Studio Code.
48
+
49
+ ## Visual Studio Code is not working like the ISE
34
50
35
51
The PowerShell extension does not aim to perfectly recreate
36
52
the experience of the PowerShell ISE.
@@ -45,7 +61,7 @@ VSCode itself and can't be changed by the extension.
45
61
The VSCode maintainers are quite reasonable though,
46
62
and you can ask for new features [ in their repository] ( https://github.com/Microsoft/vscode ) .
47
63
48
- ## Known Issues in the Extension
64
+ ## Known issues in the extension
49
65
50
66
- If you are running the Preview version "PowerShell Preview" side-by-side with the stable version "PowerShell"
51
67
you will experience performance and debug issues.
@@ -84,7 +100,7 @@ and you can ask for new features [in their repository](https://github.com/Micros
84
100
may be opportunities to improve our integration with it in the
85
101
[ PowerShell Extension] too.
86
102
87
- ## Reporting an Issue
103
+ ## Reporting an issue
88
104
89
105
If you experience a problem with the [ PowerShell Extension] :
90
106
@@ -97,7 +113,7 @@ If you experience a problem with the [PowerShell Extension]:
97
113
[ look there] .
98
114
3 . If you don't see the issue you're experiencing, please [ open a new issue] .
99
115
100
- ## Opening a New Issue
116
+ ## Opening a new issue
101
117
102
118
If you experience an issue with the [ PowerShell Extension] and can't find
103
119
an existing issue for it, [ open an issue on us on GitHub] .
@@ -118,7 +134,7 @@ When opening an issue, keep in mind:
118
134
[ tackling an issue] , we always accept contributions and will help you
119
135
at every step.
120
136
121
- ## Reproducing the Issue
137
+ ## Reproducing the issue
122
138
123
139
To fix the issue, we need to be able to reproduce it.
124
140
To do that, we need:
@@ -134,7 +150,7 @@ the GitHub issue template will have sections
134
150
to guide you through providing all of this information
135
151
as well as environment information discussed below.
136
152
137
- ## Providing Information About Your Environment
153
+ ## Providing information about your environment
138
154
139
155
For solving most issues, the following information is important to provide:
140
156
@@ -213,7 +229,7 @@ At this point, you may delete the setting if you want.
213
229
vscode-powershell@microsoft.com . Please still open an issue though
214
230
so we can track the work &mdash ; other users may have the same issue.
215
231
216
- ### Visual Studio Code Version
232
+ ### Visual Studio Code version
217
233
218
234
[ Your VSCode version] can be obtained from the Integrated Console
219
235
or PowerShell like this:
@@ -245,7 +261,7 @@ code: The term 'code' is not recognized as the name of a cmdlet, ...
245
261
in this case, use the file menu in VSCode and choose ` Help ` >` About `
246
262
(or ` Code ` >` About Visual Studio Code ` on macOS) to get version information.
247
263
248
- ### PowerShell Extension Version
264
+ ### PowerShell extension version
249
265
250
266
[ Your installed PowerShell Extension version] can similarly be found with:
251
267
@@ -278,7 +294,8 @@ If VSCode isn't on your path use the [Command Palette]
278
294
(<kbd >Ctrl</kbd >+<kbd >Shift</kbd >+<kbd >P</kbd >) to enter
279
295
` Extensions: Show Installed Extensions ` and list your extensions.
280
296
281
- ### Editor Services Version
297
+ ### Editor Services version
298
+
282
299
To get the [ PowerShell Editor Services] version, in the Integrated
283
300
Console, enter:
284
301
@@ -289,7 +306,8 @@ Major Minor Build Revision
289
306
1 8 4 0
290
307
```
291
308
292
- ### PowerShell Version Table
309
+ ### PowerShell version table
310
+
293
311
You can get [ your PowerShell version table] from the Integrated Console:
294
312
295
313
``` powershell
@@ -307,7 +325,7 @@ SerializationVersion 1.1.0.1
307
325
WSManStackVersion 3.0
308
326
```
309
327
310
- ### Operating System Information
328
+ ### Operating system information
311
329
312
330
- Windows - all needed information should already be in the ` $PSVersionTable `
313
331
- macOS
@@ -316,7 +334,7 @@ WSManStackVersion 3.0
316
334
- ` uname -a `
317
335
- Your distro and version (usually ` lsb_release -a ` is the best here)
318
336
319
- ### Note on Security
337
+ ### Note on security
320
338
321
339
If you believe there is a security vulnerability in the [ PowerShell Extension]
322
340
(or in [ PowerShell Editor Services] ), it ** must** be reported directly to
@@ -328,7 +346,6 @@ an issue on GitHub is appropriate.
328
346
[ PowerShell Editor Services ] : https://github.com/PowerShell/PowerShellEditorServices
329
347
[ PowerShell Extension ] : https://github.com/PowerShell/vscode-powershell/
330
348
[ PSScriptAnalyzer ] : https://github.com/PowerShell/PSScriptAnalyzer
331
- [ PSReadLine ] : https://github.com/lzybkr/PSReadLine
332
349
333
350
[ Command Palette ] : https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
334
351
[ Coordinated Vulnerability Disclosure ] : https://technet.microsoft.com/security/dn467923
0 commit comments