Skip to content

Commit 9f953fe

Browse files
authored
Merge pull request #78524 from ggailey777/tyler
Tyler: add docs on switching to PowerShell Core
2 parents ef19c4b + fe4fbdc commit 9f953fe

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

articles/azure-functions/functions-debug-powershell-local.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,29 @@ With `Wait-Debugger` in place, you can now debug the functions using either Visu
9191

9292
## Debug in Visual Studio Code
9393

94-
To debug your PowerShell functions in Visual Studio Code, you must have the following extensions for Visual Studio Code:
94+
To debug your PowerShell functions in Visual Studio Code, you must have the following installed:
9595

96-
* [PowerShell](/powershell/scripting/components/vscode/using-vscode)
97-
* [Azure Functions](functions-create-first-function-vs-code.md)
96+
* [PowerShell extension for Visual Studio Code](/powershell/scripting/components/vscode/using-vscode)
97+
* [Azure Functions extension for Visual Studio Code](functions-create-first-function-vs-code.md)
98+
* [PowerShell Core 6.2 or higher](/powershell/scripting/install/installing-powershell#powershell-core)
9899

99-
After installing the PowerShell and Azure Functions extensions, load an existing function app project. You can also [create a Functions project](functions-create-first-function-vs-code.md).
100+
After installing these dependencies, load an existing PowerShell Functions project, or [create your first PowerShell Functions project](functions-create-first-function-powershell.md).
100101

101102
>[!NOTE]
102103
> Should your project not have the needed configuration files, you are prompted to add them.
103104
105+
### Set the PowerShell version
106+
107+
PowerShell Core installs side by side with Windows PowerShell. Set PowerShell Core as the PowerShell version to use with the PowerShell extension for Visual Studio Code.
108+
109+
1. Press F1 to display the command pallet, then search for `Session`.
110+
111+
1. Choose **PowerShell: Show Session Menu**.
112+
113+
1. If your **Current session** isn't **PowerShell Core 6**, choose **Switch to: PowerShell Core 6**.
114+
115+
When you have a PowerShell file open, you see the version displayed in green at the bottom right of the window. Selecting this text also displays the session menu. To learn more, see the [Choosing a version of PowerShell to use with the extension](/powershell/scripting/components/vscode/using-vscode#choosing-a-version-of-powershell-to-use-with-the-extension).
116+
104117
### Start the function app
105118

106119
Verify that `Wait-Debugger` is set in the function where you want to attach the debugger. With `Wait-Debugger` added, you can debug your function app using Visual Studio Code.
@@ -136,7 +149,7 @@ After you continue and fully invoke your script, you'll notice that:
136149
* The PowerShell console that did the `Invoke-RestMethod` has returned a result
137150
* The PowerShell Integrated Console in Visual Studio Code is waiting for a script to be executed
138151

139-
Subsequent times when you invoke the same function, the debugger in PowerShell extension breaks right after the `Wait-Debugger`.
152+
Later when you invoke the same function, the debugger in PowerShell extension breaks right after the `Wait-Debugger`.
140153

141154
## Debugging in a PowerShell Console
142155

0 commit comments

Comments
 (0)