PowerShell Pro Tools
Ironman SoftwareGitHub
  • About
  • System Requirements
  • PowerShell Tools Documentation
    • Visual Studio
      • Analysis
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Format Document
      • Go to Definition
      • Packaging in Visual Studio
      • PowerShell 7 Support
      • PowerShell Interactive Window
      • Project System
        • Advanced
        • Debug
        • Build Events
      • Settings
        • General
        • .editorconfig
        • Analysis
        • Diagnostics
      • Tool Windows
      • Refactoring
      • Unit Test Adapter
      • User Interface Design
        • Windows Forms
  • PowerShell Pro Tools Documentation
    • Visual Studio Code
      • Automating Visual Studio Code
      • Code Conversion
      • Debugging
        • Run in New Terminal
        • One-Click Attach
      • Decompiler
      • Diagnostics
      • Enhanced Hover
      • Generating a UI from a function
      • Generate a Tool from a Function
      • Packaging in Visual Studio Code
      • Pin Session
      • PowerShell Explorer
      • Profiler
      • Sign On Save
      • RapidSense
      • Refactoring
      • Rename Symbols
      • Quick Scripts
      • Windows Forms Designer
    • Installers
    • Packaging
      • Package.psd1
      • PowerShell Packager
      • Package Hosts
      • Package as Service
      • Packaging on Linux
      • Packaging on Mac OS X
      • Continuous Integration
      • Anti-Virus
    • PowerShell Module
      • Global Hotkeys
      • Show-PSEditor
      • Show-PSScriptPad
      • Show-TUIDesigner
      • ConvertTo-CSharp
      • ConvertTo-PowerShell
      • Merge-Script
      • Install-PoshProToolsLicense
      • about_MergeScriptConfig
      • Show-WinFormDesigner
    • PowerShell Protect
      • Getting Started
      • Installation
      • Actions
      • Rules
      • Configuration
    • PSCommander
    • PSScriptPad
    • Installation and Licensing
      • Visual Studio Offline Installation
  • Changelog
    • PowerShell Tools for Visual Studio
    • PowerShell Pro Tools for Visual Studio Code
    • PowerShell Packager
    • PSScriptPad
    • PowerShell Pro Tools Module
Powered by GitBook
On this page
  • Local Debugging
  • Executing the Debugger
  • Run from a PowerShell Project
  • Run a script from any project type
  • Execute Selection
  1. PowerShell Tools Documentation
  2. Visual Studio
  3. Debugging

Local Debugging

PreviousDebuggingNextRemote Debugging

Last updated 5 years ago

Local Debugging

Executing the Debugger

Run from a PowerShell Project

With PowerShell Tools for Visual Studio, a couple new project templates are included. When working with a script that is part of a PowerShell project, you can execute the current script by simply starting debugging like you would with any other language inside Visual Studio. Pressing F5 or the Start Debugging button will allow you to execute and debug your script.

To create a PowerShell Project, just navigate to File->New->Project and select one of the PowerShell project types.

Run a script from any project type

Scripts can also be run from any type of project using the context menu items or shortcut commands. Right clicking in a PowerShell script will show the option to run the script or the selection.

You can also run a script from the solution explorer. Just right click on the script and select Execute as Script.

Execute Selection

You can execute a selection using the Ctrl+F8 key or by right clicking the code and clicking Execute Selection.

You can execute a selection from within a PS1 file.