# Debug PowerShell script in Visual Studio 2017

**URL:** <https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171>\
**Category:** PowerShell Help\
**Created:** [August 20, 2018, 1:22pm UTC](https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171 "2018-08-20T13:22:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![azad](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@azad](https://forums.powershell.org/u/azad)\
**Post date:** [August 20, 2018, 1:22pm UTC](https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171/1 "2018-08-20T13:22:43Z")

</div>

I have installed PS tools and PS pro tools for Visual Studio 2017 and was hoping that I could use VS to both edit and also run and debug powershell scripts, however so far I have not found the way to run and debug a single Powershell script from inside VS 2017. Is this feature available at all within PS tools for VS 2017 or I am just expecting too much?

---

<div class="post-metadata">

**Author:** ![rob-simmers](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rob-simmers/32/1010_2.png) [@rob-simmers](https://forums.powershell.org/u/rob-simmers)\
**Post date:** [August 20, 2018, 2:05pm UTC](https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171/2 "2018-08-20T14:05:09Z")

</div>

I’ve done work on C# modules in Visual Studio, but the preferred software for Powershell currently is [Visual Studio Code](https://code.visualstudio.com/), not the full Visual Studio:

> **[Get started with PowerShell development in Visual Studio Code](https://devblogs.microsoft.com/scripting/get-started-with-powershell-development-in-visual-studio-code/)**
>
> Summary: Learn about the features in Visual Studio Code that help you write PowerShell code. Since the PowerShell integrated scripting environment (ISE) shipped with Windows PowerShell 2.0 in 2009, the PowerShell landscape has changed significantly....

[https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/vscode/using-vscode?view=powershell-6](https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/vscode/using-vscode?view=powershell-6)

Code allows you to use F8 to execute code similar to the Powershell ISE with a Powershell emulator already attached.

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [August 20, 2018, 2:13pm UTC](https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171/3 "2018-08-20T14:13:17Z")

</div>

See this discussion and answer.

> Create the file C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.config:
> 
> ‘[debugging - Can't debug PowerShell through Visual Studio - Stack Overflow](http://stackoverflow.com/questions/4106881/cant-debug-powershell-through-visual-studio)’

  
And view this video …

> PowerShell Tools for Visual Studio 'youtube.com/watch?v=eRILgGQb\_hQ'

&nbsp;

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/debug-powershell-script-in-visual-studio-2017/11171/4 "2024-05-16T20:34:31Z")

</div>

Closed on May 16, 2024, 8:34pm UTC


