From 72cd28c3366e0d7511f586f41cfd0d1ba8407520 Mon Sep 17 00:00:00 2001 From: v-alexjo Date: Thu, 9 Jun 2016 15:00:52 -0700 Subject: [PATCH 1/4] Moving debugging tests out of Set-PSBreakpoint tests --- .../singleshell/config/MshSnapinInfo.cs | 4 +- test/powershell/PSDebugging.Tests.ps1 | 148 ++++++++++++++++++ 2 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 test/powershell/PSDebugging.Tests.ps1 diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index 361d3c7cc1..eb6bd942e0 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1408,7 +1408,7 @@ namespace System.Management.Automation { defaultMshSnapins = new List() { -#if !LINUX // Microsoft.PowerShell.Commands.Diagnostics.dll needs to be ported +#if !PORTABLE // Microsoft.PowerShell.Commands.Diagnostics.dll needs to be ported new DefaultPSSnapInInformation("Microsoft.PowerShell.Diagnostics", "Microsoft.PowerShell.Commands.Diagnostics", null, "GetEventResources,Description", "GetEventResources,Vendor"), #endif @@ -1427,7 +1427,7 @@ namespace System.Management.Automation "SecurityMshSnapInResources,Description","SecurityMshSnapInResources,Vendor") }; -#if !LINUX +#if !CORECLR //TODO:CORECLR - The 'Microsoft.WSMan.Management' module will be available on OneCore soon if (!Utils.IsWinPEHost()) { defaultMshSnapins.Add(new DefaultPSSnapInInformation("Microsoft.WSMan.Management", "Microsoft.WSMan.Management", null, diff --git a/test/powershell/PSDebugging.Tests.ps1 b/test/powershell/PSDebugging.Tests.ps1 new file mode 100644 index 0000000000..9dd964c13c --- /dev/null +++ b/test/powershell/PSDebugging.Tests.ps1 @@ -0,0 +1,148 @@ +using namespace System.Diagnostics + +Describe "PowerShell Command Debugging"{ + $powershell = Join-Path -Path $PsHome -ChildPath "powershell" + +function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) + { + return [ProcessStartInfo]@{ + FileName = $powershell + Arguments = $CommandLine + RedirectStandardInput = $RedirectStdIn + RedirectStandardOutput = $true + RedirectStandardError = $true + UseShellExecute = $false + } + } + + function RunPowerShell([ProcessStartInfo]$debugfn) + { + $process = [Process]::Start($debugfn) + return $process + } + + + function EnsureChildHasExited([Process]$process, [int]$WaitTimeInMS = 15000) + { + $process.WaitForExit($WaitTimeInMS) + + if (!$process.HasExited) + { + $process.HasExited | Should Be $true + $process.Kill() + } + } + + It "Should be able to step into debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + foreach ($i in 1..2) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("foo`n") + + foreach ($i in 1..13) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $process.ExitCode | Should Be 0 + } + + It "Should be able to continue into debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + foreach ($i in 1..2) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("foo`n") + + foreach ($i in 1..13) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("c`n") + $process.StandardOutput.ReadLine() + $process.StandardOutput.ReadLine() + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $process.ExitCode | Should Be 0 + } + + It "Should be able to list help for debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + foreach ($i in 1..2) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("foo`n") + + foreach ($i in 1..13) { + $process.StandardOutput.ReadLine() + } + $process.StandardInput.Write("h`n") + foreach ($i in 1..23) { + $line = $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + + foreach ($i in 1..3) { + $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $line | Should Be "For instructions about how to customize your debugger prompt, type `"help about_prompt`"." +# $process.ExitCode | Should Be 0 + + + + } +} + + + From f483429d110cafc2645969e6ff8a95aa9baa5c42 Mon Sep 17 00:00:00 2001 From: v-alexjo Date: Fri, 10 Jun 2016 09:38:51 -0700 Subject: [PATCH 2/4] Guarding Diagonstics to fix powershell debugging on Linux --- test/powershell/PSDebugging.Tests.ps1 | 143 ++++++++++++++++---------- 1 file changed, 90 insertions(+), 53 deletions(-) diff --git a/test/powershell/PSDebugging.Tests.ps1 b/test/powershell/PSDebugging.Tests.ps1 index 9dd964c13c..180b9dcf19 100644 --- a/test/powershell/PSDebugging.Tests.ps1 +++ b/test/powershell/PSDebugging.Tests.ps1 @@ -38,33 +38,14 @@ function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - foreach ($i in 1..2) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("foo`n") - foreach ($i in 1..13) { - $process.StandardOutput.ReadLine() - } + $process.StandardInput.Write("s`n") $process.StandardInput.Write("s`n") - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() } - $process.StandardInput.Write("s`n") - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() - } - - $process.StandardInput.Write("s`n") - - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Close() EnsureChildHasExited $process @@ -76,16 +57,8 @@ function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - foreach ($i in 1..2) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("foo`n") - foreach ($i in 1..13) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("c`n") $process.StandardOutput.ReadLine() $process.StandardOutput.ReadLine() @@ -101,47 +74,111 @@ function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - foreach ($i in 1..2) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("foo`n") - foreach ($i in 1..13) { - $process.StandardOutput.ReadLine() - } $process.StandardInput.Write("h`n") - foreach ($i in 1..23) { + + foreach ($i in 1..38) { $line = $process.StandardOutput.ReadLine() } $process.StandardInput.Write("s`n") - - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("s`n") - - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Write("s`n") - - foreach ($i in 1..3) { - $process.StandardOutput.ReadLine() - } - $process.StandardInput.Close() EnsureChildHasExited $process $line | Should Be "For instructions about how to customize your debugger prompt, type `"help about_prompt`"." -# $process.ExitCode | Should Be 0 + } - + + It "Should be able to step over debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("v`n") + $process.StandardInput.Write("v`n") + $process.StandardInput.Write("v`n") + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $process.ExitCode | Should Be 0 + } + + + It "Should be able to step out of debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("o`n") + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $process.ExitCode | Should Be 0 + } + + It "Should be able to quit debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") + + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("q`n") + + $process.StandardInput.Close() + + EnsureChildHasExited $process + $process.ExitCode | Should Be 0 + } + + It "Should be able to list source code in debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host + + $process.StandardInput.Write("foo`n") | Write-Host + $process.StandardInput.Write("l`n") | Write-Host + + foreach ($i in 1..19) { + $line = $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("`n") + $process.StandardInput.Write("`n") + $process.StandardInput.Write("`n") + + $line | Should Be " 1:* `$function:foo = { 'bar' }" + $process.StandardInput.Close() + EnsureChildHasExited $process } + + + It "Should be able to get the call stack in debugging"{ + $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn + $process = RunPowerShell $debugfn + $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host + + $process.StandardInput.Write("foo`n") | Write-Host + $process.StandardInput.Write("k`n") | Write-Host + + foreach ($i in 1..20) { + $line = $process.StandardOutput.ReadLine() + } + + $line | Should Be "foo {} " + $process.StandardInput.Close() + EnsureChildHasExited $process + + } + + } From acd9249fe2e5a951fa9d7f1c8d2765d03432a274 Mon Sep 17 00:00:00 2001 From: v-alexjo Date: Fri, 10 Jun 2016 10:15:33 -0700 Subject: [PATCH 3/4] Added PORTABLE as define for debugging and reidented tests. --- src/System.Management.Automation/project.json | 2 +- .../singleshell/config/MshSnapinInfo.cs | 2 +- test/powershell/PSDebugging.Tests.ps1 | 198 +++++++++--------- 3 files changed, 101 insertions(+), 101 deletions(-) diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index deb7012089..c5a4697bf0 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -24,7 +24,7 @@ "netstandard1.5": { "imports": [ "dnxcore50" ], "buildOptions": { - "define": [ "CORECLR" ], + "define": [ "CORECLR", "PORTABLE" ], "compile": { "exclude": [ "cimSupport/cmdletization/xml/cmdlets-over-objects.objectModel.autogen.cs", diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index eb6bd942e0..2baed477bf 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1427,7 +1427,7 @@ namespace System.Management.Automation "SecurityMshSnapInResources,Description","SecurityMshSnapInResources,Vendor") }; -#if !CORECLR //TODO:CORECLR - The 'Microsoft.WSMan.Management' module will be available on OneCore soon +#if !LINUX if (!Utils.IsWinPEHost()) { defaultMshSnapins.Add(new DefaultPSSnapInInformation("Microsoft.WSMan.Management", "Microsoft.WSMan.Management", null, diff --git a/test/powershell/PSDebugging.Tests.ps1 b/test/powershell/PSDebugging.Tests.ps1 index 180b9dcf19..6559572261 100644 --- a/test/powershell/PSDebugging.Tests.ps1 +++ b/test/powershell/PSDebugging.Tests.ps1 @@ -1,182 +1,182 @@ using namespace System.Diagnostics Describe "PowerShell Command Debugging"{ - $powershell = Join-Path -Path $PsHome -ChildPath "powershell" + $powershell = Join-Path -Path $PsHome -ChildPath "powershell" -function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) - { - return [ProcessStartInfo]@{ - FileName = $powershell - Arguments = $CommandLine - RedirectStandardInput = $RedirectStdIn - RedirectStandardOutput = $true - RedirectStandardError = $true - UseShellExecute = $false - } + function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) + { + return [ProcessStartInfo]@{ + FileName = $powershell + Arguments = $CommandLine + RedirectStandardInput = $RedirectStdIn + RedirectStandardOutput = $true + RedirectStandardError = $true + UseShellExecute = $false } - - function RunPowerShell([ProcessStartInfo]$debugfn) - { - $process = [Process]::Start($debugfn) - return $process - } - - - function EnsureChildHasExited([Process]$process, [int]$WaitTimeInMS = 15000) - { - $process.WaitForExit($WaitTimeInMS) + } - if (!$process.HasExited) - { - $process.HasExited | Should Be $true - $process.Kill() - } + function RunPowerShell([ProcessStartInfo]$debugfn) + { + $process = [Process]::Start($debugfn) + return $process + } + + + function EnsureChildHasExited([Process]$process, [int]$WaitTimeInMS = 15000) + { + $process.WaitForExit($WaitTimeInMS) + + if (!$process.HasExited) + { + $process.HasExited | Should Be $true + $process.Kill() } - - It "Should be able to step into debugging"{ + } + + It "Should be able to step into debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") $process.StandardInput.Write("foo`n") - - $process.StandardInput.Write("s`n") - $process.StandardInput.Write("s`n") + $process.StandardInput.Write("s`n") - $process.StandardInput.Write("s`n") + $process.StandardInput.Write("s`n") + + $process.StandardInput.Write("s`n") + + $process.StandardInput.Close() - $process.StandardInput.Close() - EnsureChildHasExited $process $process.ExitCode | Should Be 0 - } - - It "Should be able to continue into debugging"{ + } + + It "Should be able to continue into debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") $process.StandardInput.Write("foo`n") - - $process.StandardInput.Write("c`n") - $process.StandardOutput.ReadLine() - $process.StandardOutput.ReadLine() - $process.StandardInput.Close() - + $process.StandardInput.Write("c`n") + $process.StandardOutput.ReadLine() + $process.StandardOutput.ReadLine() + + $process.StandardInput.Close() + EnsureChildHasExited $process $process.ExitCode | Should Be 0 - } + } - It "Should be able to list help for debugging"{ + It "Should be able to list help for debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") $process.StandardInput.Write("foo`n") - - $process.StandardInput.Write("h`n") - foreach ($i in 1..38) { - $line = $process.StandardOutput.ReadLine() - } + $process.StandardInput.Write("h`n") + + foreach ($i in 1..38) { + $line = $process.StandardOutput.ReadLine() + } + + $process.StandardInput.Write("s`n") + $process.StandardInput.Write("s`n") + $process.StandardInput.Write("s`n") + $process.StandardInput.Close() - $process.StandardInput.Write("s`n") - $process.StandardInput.Write("s`n") - $process.StandardInput.Write("s`n") - $process.StandardInput.Close() - EnsureChildHasExited $process - $line | Should Be "For instructions about how to customize your debugger prompt, type `"help about_prompt`"." - } + $line | Should Be "For instructions about how to customize your debugger prompt, type `"help about_prompt`"." + } - It "Should be able to step over debugging"{ + It "Should be able to step over debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - $process.StandardInput.Write("foo`n") - $process.StandardInput.Write("v`n") - $process.StandardInput.Write("v`n") - $process.StandardInput.Write("v`n") + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("v`n") + $process.StandardInput.Write("v`n") + $process.StandardInput.Write("v`n") + + $process.StandardInput.Close() - $process.StandardInput.Close() - EnsureChildHasExited $process $process.ExitCode | Should Be 0 - } + } - It "Should be able to step out of debugging"{ + It "Should be able to step out of debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - $process.StandardInput.Write("foo`n") - $process.StandardInput.Write("o`n") + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("o`n") + + $process.StandardInput.Close() - $process.StandardInput.Close() - EnsureChildHasExited $process $process.ExitCode | Should Be 0 - } + } - It "Should be able to quit debugging"{ + It "Should be able to quit debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") - $process.StandardInput.Write("foo`n") - $process.StandardInput.Write("q`n") + $process.StandardInput.Write("foo`n") + $process.StandardInput.Write("q`n") + + $process.StandardInput.Close() - $process.StandardInput.Close() - EnsureChildHasExited $process $process.ExitCode | Should Be 0 - } + } - It "Should be able to list source code in debugging"{ + It "Should be able to list source code in debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host - $process.StandardInput.Write("foo`n") | Write-Host - $process.StandardInput.Write("l`n") | Write-Host + $process.StandardInput.Write("foo`n") | Write-Host + $process.StandardInput.Write("l`n") | Write-Host - foreach ($i in 1..19) { - $line = $process.StandardOutput.ReadLine() - } + foreach ($i in 1..19) { + $line = $process.StandardOutput.ReadLine() + } - $process.StandardInput.Write("`n") - $process.StandardInput.Write("`n") - $process.StandardInput.Write("`n") + $process.StandardInput.Write("`n") + $process.StandardInput.Write("`n") + $process.StandardInput.Write("`n") - $line | Should Be " 1:* `$function:foo = { 'bar' }" - $process.StandardInput.Close() + $line | Should Be " 1:* `$function:foo = { 'bar' }" + $process.StandardInput.Close() EnsureChildHasExited $process - } + } - It "Should be able to get the call stack in debugging"{ + It "Should be able to get the call stack in debugging"{ $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host - $process.StandardInput.Write("foo`n") | Write-Host - $process.StandardInput.Write("k`n") | Write-Host + $process.StandardInput.Write("foo`n") | Write-Host + $process.StandardInput.Write("k`n") | Write-Host - foreach ($i in 1..20) { - $line = $process.StandardOutput.ReadLine() - } + foreach ($i in 1..20) { + $line = $process.StandardOutput.ReadLine() + } - $line | Should Be "foo {} " - $process.StandardInput.Close() + $line | Should Be "foo {} " + $process.StandardInput.Close() EnsureChildHasExited $process - } + } } From 7d1ce6507907df3b68bfd774c3c9b902b8274a05 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 15 Jun 2016 12:36:17 -0700 Subject: [PATCH 4/4] Mark tests as pending on Travis's OS X and on Windows Because redirected `stdin` does not yet work on Windows, and because any output based test does not yet work on OS X on Travis (where this is no TTY), we cannot yet run these tests on those platforms. --- test/powershell/PSDebugging.Tests.ps1 | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/test/powershell/PSDebugging.Tests.ps1 b/test/powershell/PSDebugging.Tests.ps1 index 6559572261..e8b8515eea 100644 --- a/test/powershell/PSDebugging.Tests.ps1 +++ b/test/powershell/PSDebugging.Tests.ps1 @@ -1,7 +1,17 @@ using namespace System.Diagnostics -Describe "PowerShell Command Debugging"{ - $powershell = Join-Path -Path $PsHome -ChildPath "powershell" +Describe "PowerShell Command Debugging" { + + BeforeAll { + # These tests cannot yet be run on OS X on Travis, or on any Windows, due to redirected stdin problems + if ($env:TRAVIS_OS_NAME -eq "osx" -or $IsWindows) { + $ItArgs = @{ pending = $true } + } else { + $ItArgs = @{} + } + + $powershell = Join-Path -Path $PsHome -ChildPath "powershell" + } function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) { @@ -33,7 +43,7 @@ Describe "PowerShell Command Debugging"{ } } - It "Should be able to step into debugging"{ + It @ItArgs "Should be able to step into debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -52,7 +62,7 @@ Describe "PowerShell Command Debugging"{ $process.ExitCode | Should Be 0 } - It "Should be able to continue into debugging"{ + It @ItArgs "Should be able to continue into debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -69,7 +79,7 @@ Describe "PowerShell Command Debugging"{ $process.ExitCode | Should Be 0 } - It "Should be able to list help for debugging"{ + It @ItArgs "Should be able to list help for debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -92,7 +102,7 @@ Describe "PowerShell Command Debugging"{ } - It "Should be able to step over debugging"{ + It @ItArgs "Should be able to step over debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -109,7 +119,7 @@ Describe "PowerShell Command Debugging"{ } - It "Should be able to step out of debugging"{ + It @ItArgs "Should be able to step out of debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -123,7 +133,7 @@ Describe "PowerShell Command Debugging"{ $process.ExitCode | Should Be 0 } - It "Should be able to quit debugging"{ + It @ItArgs "Should be able to quit debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") @@ -137,7 +147,7 @@ Describe "PowerShell Command Debugging"{ $process.ExitCode | Should Be 0 } - It "Should be able to list source code in debugging"{ + It @ItArgs "Should be able to list source code in debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host @@ -160,7 +170,7 @@ Describe "PowerShell Command Debugging"{ } - It "Should be able to get the call stack in debugging"{ + It @ItArgs "Should be able to get the call stack in debugging" { $debugfn = NewProcessStartInfo "-noprofile ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn $process.StandardInput.Write("Set-PsBreakpoint -command foo`n") | Write-Host