- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the line breakpoint in the PowerShell?
To set the line breakpoint in the script, we can use the Set-PSBreakpoint command with -Line parameter and need to give the path of the script on which the Line breakpoint needs to set.
Consider we have the script below which retrieves the value up to 99, starting from 1,
We will set the Line Breakpoint at line number 3 so we will use the below command. Here the script name is WhieScript.ps1 and stored at C:\temp.
Set-PSBreakpoint C:\temp\WhileScript.ps1 -Line 3
Once you run the above command, you will get the output with the details as shown below.
ID Script Line Command Variable Action -- ------ ---- ------- -------- ------ 6 WhileScript.ps1 3
To check all the applied breakpoints, you can use the Get-PSBreakPoint command.
Now to enter the debug mode, you need to run the script.
You can see in the above image that the console has entered debug mode. To continue till the next breakpoint, press ‘C’.
There are other keywords for step in, step out, exit, etc. You can check them below at the MS site.
- Related Articles
- What is the breakpoint in PowerShell?
- How to use the Set-Location command in PowerShell?
- How to add Exception Breakpoint in Xcode?
- How to set the line color in Python Plotly?
- How to get the tags of the availability set using PowerShell?
- How to set the local user account settings using PowerShell?
- How to list the Azure VMs from the Availability set using PowerShell?
- How to set the angle of a Line in FabricJS?
- How to set the background colour of Line in FabricJS?
- How to Set environment variables using PowerShell?
- How to find the disk type of the Azure Availability set using PowerShell?
- How to set the border colour of a Line in FabricJS?
- Using Breakpoint in SAP system
- How to get the fault domain count of the Azure Availability set using PowerShell?
- How to get the update domain count of the Azure Availability set using PowerShell?