@@ -192,7 +192,7 @@ For example, the following command gets the variables in the local (script)
192192scope:
193193
194194``` powershell
195- Get-Variable -scope 0
195+ Get-Variable -Scope 0
196196```
197197
198198This is a useful way to see only the variables that you defined in the script
@@ -225,17 +225,17 @@ For example:
225225``` powershell
226226function test-cmdlet {
227227 begin {
228- write-output "Begin"
228+ Write-Output "Begin"
229229 }
230230 process {
231- write-output "Process"
231+ Write-Output "Process"
232232 }
233233 end {
234- write-output "End"
234+ Write-Output "End"
235235 }
236236}
237237
238- C:\PS> Set-PSBreakpoint -command test-cmdlet
238+ C:\PS> Set-PSBreakpoint -Command test-cmdlet
239239
240240C:\PS> test-cmdlet
241241
@@ -285,7 +285,7 @@ identifying changes to the prompt:
285285
286286``` powershell
287287Enter-PSSession -Cn localhost
288- [localhost]: PS C:\psscripts> Set-PSBreakpoint .\ttest19.ps1 6,11,22,25
288+ [localhost]: PS C:\psscripts> Set-PSBreakpoint .\ttest19.ps1 6, 11, 22, 25
289289
290290ID Script Line Command Variable Action
291291-- ------ ---- ------- -------- ------
@@ -367,7 +367,7 @@ Start by creating a line breakpoint on the first line of the Test.ps1 script in
367367the current directory.
368368
369369``` powershell
370- PS C:\ps-test> Set-PSBreakpoint -line 1 -script test.ps1
370+ PS C:\ps-test> Set-PSBreakpoint -Line 1 -Script test.ps1
371371```
372372
373373The command returns a ** System.Management.Automation.LineBreakpoint** object.
@@ -482,7 +482,7 @@ reuse the breakpoint, use the `Disable-PsBreakpoint` cmdlet instead of
482482` Remove-PsBreakpoint ` .)
483483
484484``` powershell
485- PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint
485+ PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint
486486```
487487
488488You can abbreviate this command as:
@@ -501,13 +501,13 @@ function delbr { gbp | rbp }
501501Now, create a breakpoint on the ` $scriptname ` variable.
502502
503503``` powershell
504- PS C:\ps-test> Set-PSBreakpoint -variable scriptname -script test.ps1
504+ PS C:\ps-test> Set-PSBreakpoint -Variable scriptname -Script test.ps1
505505```
506506
507507You can abbreviate the command as:
508508
509509``` powershell
510- PS C:\ps-test> sbp -v scriptname -s test.ps1
510+ PS C:\ps-test> sbp -V scriptname -S test.ps1
511511```
512512
513513Now, start the script. The script reaches the variable breakpoint. The default
@@ -557,8 +557,8 @@ Have you run a background job today (start-job)?
557557test.ps1:13 "Done $scriptName"
558558```
559559
560- The ` StepOver ` command executes the function, and it previews the next statement
561- in the script, which prints the final line.
560+ The ` StepOver ` command executes the function, and it previews the next
561+ statement in the script, which prints the final line.
562562
563563Use a ` Stop ` command (` t ` ) to exit the debugger. The command prompt reverts to
564564the standard command prompt.
@@ -571,19 +571,19 @@ To delete the breakpoints, use the `Get-PsBreakpoint` and `Remove-PsBreakpoint`
571571cmdlets.
572572
573573``` powershell
574- PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint
574+ PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint
575575```
576576
577577Create a new command breakpoint on the ` psversion ` function.
578578
579579``` powershell
580- PS C:\ps-test> Set-PSBreakpoint -command psversion -script test.ps1
580+ PS C:\ps-test> Set-PSBreakpoint -Command psversion -Script test.ps1
581581```
582582
583583You can abbreviate this command to:
584584
585585``` powershell
586- PS C:\ps-test> sbp -c psversion -s test.ps1
586+ PS C:\ps-test> sbp -C psversion -S test.ps1
587587```
588588
589589Now, run the script.
@@ -612,7 +612,7 @@ Windows PowerShell 2.0
612612Have you run a background job today (start-job)?
613613Done C:\ps-test\test.ps1
614614
615- PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint
615+ PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint
616616PS C:\ps-test>
617617```
618618
@@ -623,9 +623,9 @@ the action, execution doesn't stop. The backtick (`` ` ``) is the
623623line-continuation character.
624624
625625``` powershell
626- PS C:\ps-test> Set-PSBreakpoint -command psversion -script test.ps1 `
627- -action { add-content "The value of `$scriptName is $scriptName." `
628- -path action.log}
626+ PS C:\ps-test> Set-PSBreakpoint -Command psversion -Script test.ps1 `
627+ -Action { Add-Content "The value of `$scriptName is $scriptName." `
628+ -Path action.log}
629629```
630630
631631You can also add actions that set conditions for the breakpoint. In the
@@ -634,8 +634,8 @@ policy is set to RemoteSigned, the most restrictive policy that still permits
634634you to run scripts.
635635
636636``` powershell
637- PS C:\ps-test> Set-PSBreakpoint -script test.ps1 -command psversion `
638- -action { if ((Get-ExecutionPolicy) -eq "RemoteSigned") { break }}
637+ PS C:\ps-test> Set-PSBreakpoint -Script test.ps1 -Command psversion `
638+ -Action { if ((Get-ExecutionPolicy) -eq "RemoteSigned") { break }}
639639```
640640
641641The ` break ` keyword in the action directs the debugger to execute the
@@ -700,7 +700,7 @@ features that you can use to debug scripts and functions.
700700
701701<!-- link references -->
702702[ 01 ] : /powershell/scripting/dev-cross-plat/vscode/using-vscode#debugging-with-visual-studio-code
703- [ 02 ] : about_prompts .md
703+ [ 02 ] : about_Prompts .md
704704[ 05 ] : xref:Microsoft.PowerShell.Utility.Disable-PSBreakpoint
705705[ 06 ] : xref:Microsoft.PowerShell.Utility.Enable-PSBreakpoint
706706[ 07 ] : xref:Microsoft.PowerShell.Utility.Get-PSBreakpoint
0 commit comments