From 090dfdc24f18cd0d07efe2a830a7aa9b31bd1d71 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:20:50 +0000 Subject: [PATCH 01/16] Added pester test for Get-Event --- src/pester-tests/Get-Event.Tests.ps1 | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/pester-tests/Get-Event.Tests.ps1 diff --git a/src/pester-tests/Get-Event.Tests.ps1 b/src/pester-tests/Get-Event.Tests.ps1 new file mode 100644 index 0000000000..5eee63bba3 --- /dev/null +++ b/src/pester-tests/Get-Event.Tests.ps1 @@ -0,0 +1,33 @@ +Describe "Get-Event" { + + BeforeEach { + ( New-Event -SourceIdentifier PesterTestEvent -sender windows.timer -messagedata "PesterTestMessage" ) + } + + AfterEach { + ( Remove-Event -SourceIdentifier PesterTestEvent -ErrorAction SilentlyContinue ) + } + + Context "Check return type of Get-Event" { + + It "Should return PSEventArgs as return type of Get-Event" { + { ( Get-Event -SourceIdentifier PesterTestEvent ).GetType() | Should Be System.Management.Automation.PSEventArgs } + } + } + + Context "Validate Get-Event can retrieve event" { + + It "Should return at least 1 event" { + { (Get-Event).Count | Should BeGreaterThan 0 } + } + + It "Should return PesterTestMessage as the MessageData" { + { (Get-Event -SourceIdentifier PesterTimer).MessageData | Should Be "PesterTestMessage" } + } + + It "Should return Sender as windows.timer" { + { (Get-Event -SourceIdentifier PesterTimer).Sender | Should be windows.timer } + } + + } +} From 63f7d510fbe2786a6947c4ae3bac7dd107f99723 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:21:11 +0000 Subject: [PATCH 02/16] Added pester test for Get-RunspaceDebug --- src/pester-tests/Get-RunspaceDebug.Tests.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/pester-tests/Get-RunspaceDebug.Tests.ps1 diff --git a/src/pester-tests/Get-RunspaceDebug.Tests.ps1 b/src/pester-tests/Get-RunspaceDebug.Tests.ps1 new file mode 100644 index 0000000000..7c66ed7363 --- /dev/null +++ b/src/pester-tests/Get-RunspaceDebug.Tests.ps1 @@ -0,0 +1,9 @@ +Describe "Get-RunspaceDebug" { + + Context "Check return types of RunspaceDebug" { + + It "Should return Microsoft.Powershell.Commands.PSRunspaceDebug as the return type" { + (Get-RunspaceDebug).GetType() | Should Be Microsoft.Powershell.Commands.PSRunspaceDebug + } + } +} From 5eb2f488c8f94b77477f0c04b19d74cc7a859545 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:21:35 +0000 Subject: [PATCH 03/16] Added pester tests for Import-Alias --- src/pester-tests/Import-Alias.Tests.ps1 | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/pester-tests/Import-Alias.Tests.ps1 diff --git a/src/pester-tests/Import-Alias.Tests.ps1 b/src/pester-tests/Import-Alias.Tests.ps1 new file mode 100644 index 0000000000..b29c996e2a --- /dev/null +++ b/src/pester-tests/Import-Alias.Tests.ps1 @@ -0,0 +1,29 @@ +$here = Split-Path -Parent $MyInvocation.MyCommand.Path + +Describe "Import-Alias" { + + #Alias file with only the addition of "pesterecho" aliased to echo + $pesteraliasfile = "$here/assets/pesteralias.txt" + + Context "Validate ability to import alias file" { + + It "Should be able to import an alias file successfully" { + { Import-Alias $pesteraliasfile } | Should Not throw + } + + It "Should be able to import file via the Import-Alias alias of ipal" { + { ipal $pesteraliasfile } | Should Not throw + } + + It "Should be able to import an alias file and perform imported aliased echo cmd" { + (Import-Alias $pesteraliasfile) + (pesterecho pestertesting) | Should Be "pestertesting" + } + + It "Should be able to use ipal alias to import an alias file and perform cmd" { + (ipal $pesteraliasfile) + (pesterecho pestertesting) | Should be "pestertesting" + } + + } +} From 9bcd10fc97bf1f30784845d17c6ce98d326a7ae3 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:21:47 +0000 Subject: [PATCH 04/16] Added pester test for Invoke-Expression --- src/pester-tests/Invoke-Expression.Tests.ps1 | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/pester-tests/Invoke-Expression.Tests.ps1 diff --git a/src/pester-tests/Invoke-Expression.Tests.ps1 b/src/pester-tests/Invoke-Expression.Tests.ps1 new file mode 100644 index 0000000000..6606eaed75 --- /dev/null +++ b/src/pester-tests/Invoke-Expression.Tests.ps1 @@ -0,0 +1,31 @@ +$here = Split-Path -Parent $MyInvocation.MyCommand.Path + +Describe "Invoke-Expression" { + + Context "Should execute the invoked command validly" { + + It "Should return the echoed text" { + (Invoke-Expression -command "echo pestertest1") | Should be "pestertest1" + } + + It "Should return the echoed text for the alias" { + (iex -command "echo pestertest2") | Should Be "pestertest2" + } + + It "Should return the echoed text from a script" { + $testfile = "$here/assets/echoscript.ps1" + $testcommand = "echo pestertestscript" + $testcommand | Add-Content -Path $testfile + (Invoke-Expression $testfile) | Should Be "pestertestscript" + Remove-Item $testfile + } + + It "Should return the echoed text from a script from the alias" { + $testfile = "$here/assets/echoscript.ps1" + $testcommand = "echo pestertestscript" + $testcommand | Add-Content -Path $testfile + (iex $testfile) | Should Be "pestertestscript" + Remove-Item $testfile + } + } +} From 4ba7f81274cdf15a7ece6ed7dbce009719744bcd Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:22:06 +0000 Subject: [PATCH 05/16] Added pester tests for Measure-Command --- src/pester-tests/Measure-Command.Tests.ps1 | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/pester-tests/Measure-Command.Tests.ps1 diff --git a/src/pester-tests/Measure-Command.Tests.ps1 b/src/pester-tests/Measure-Command.Tests.ps1 new file mode 100644 index 0000000000..77029a322b --- /dev/null +++ b/src/pester-tests/Measure-Command.Tests.ps1 @@ -0,0 +1,28 @@ +$here = Split-Path -Parent $MyInvocation.MyCommand.Path + +Describe "Measure-Command" { + + Context "Validate return types for Measure-Command" { + + It "Should return TimeSpan as the return type" { + (Measure-Command { Get-Date }).GetType() | Should Be timespan + } + } + + Context "Validate that it is executing commands correctly" { + + It "Should return TimeSpan after executing a script" { + (Measure-Command { echo hi }).GetType() | Should Be timespan + } + + It "Should return TimeSpan after executing a cmdlet" { + $pesterscript = "$here/assets/echoscript.ps1" + $testfile = "$here/assets/echoscript.ps1" + $testcommand = "echo pestertestscript" + $testcommand | Add-Content -Path $testfile + + (Measure-Command { $pesterscript }).GetType() | Should Be timespan + Remove-Item $testfile + } + } +} From 621757c8a2f1f226f7911d40b81805f8357f0955 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:22:29 +0000 Subject: [PATCH 06/16] Added pester tests for Register-EngineEvent --- src/pester-tests/Register-EngineEvent.Tests.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/pester-tests/Register-EngineEvent.Tests.ps1 diff --git a/src/pester-tests/Register-EngineEvent.Tests.ps1 b/src/pester-tests/Register-EngineEvent.Tests.ps1 new file mode 100644 index 0000000000..bf5a2b935e --- /dev/null +++ b/src/pester-tests/Register-EngineEvent.Tests.ps1 @@ -0,0 +1,9 @@ +Describe "Register-EngineEvent" { + + Context "Check return type of Register-ObjectEvent" { + It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" { + ( Register-EngineEvent -SourceIdentifier PesterTestRegister -Action {echo registerengineevent} ).GetType() | Should Be System.Management.Automation.PSEventJob + Unregister-Event -sourceidentifier PesterTestRegister + } + } +} From 85f63acd868f3d069b74aaf24b8bc064157fa01a Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:22:52 +0000 Subject: [PATCH 07/16] Added pester tests for Register-ObjectEvent --- .../Register-ObjectEvent.Tests.ps1 | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/pester-tests/Register-ObjectEvent.Tests.ps1 diff --git a/src/pester-tests/Register-ObjectEvent.Tests.ps1 b/src/pester-tests/Register-ObjectEvent.Tests.ps1 new file mode 100644 index 0000000000..0e8d5c8035 --- /dev/null +++ b/src/pester-tests/Register-ObjectEvent.Tests.ps1 @@ -0,0 +1,31 @@ +Describe "Register-ObjectEvent" { + + BeforeEach { + $pesterobject = (New-Object System.Collections.ObjectModel.ObservableCollection[object]) + } + + AfterEach { + Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue + } + + Context "Check return type of Register-ObjectEvent" { + + It "Should return System.Management.Automation.PSEventSubscriber as return type of New-Event with the registered sourceidentifier" { + Register-ObjectEvent -InputObject $pesterobject -EventName CollectionChanged -SourceIdentifier PesterTestRegister + (Get-EventSubscriber -SourceIdentifier PesterTestRegister).GetType() | Should Be System.Management.Automation.PSEventSubscriber + } + } + + Context "Check Register-ObjectEvent can validly register events"{ + It "Should return source identifier of PesterTimer " { + Register-ObjectEvent -InputObject $pesterobject -EventName CollectionChanged -SourceIdentifier PesterTestRegister + (Get-EventSubscriber -SourceIdentifier PesterTestRegister).SourceIdentifier | Should Be "PesterTestRegister" + } + + It "Should return an integer greater than 0 for the SubscriptionId" { + Register-ObjectEvent -InputObject $pesterobject -EventName CollectionChanged -SourceIdentifier PesterTestRegister + (Get-EventSubscriber -SourceIdentifier PesterTestRegister).SubscriptionId | Should BeGreaterThan 0 + + } + } +} From 835a3fed1c11ff72b7da685f464846e5c67e27d6 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:23:11 +0000 Subject: [PATCH 08/16] Added pester tests for Remove-Event --- src/pester-tests/Remove-Event.Tests.ps1 | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/pester-tests/Remove-Event.Tests.ps1 diff --git a/src/pester-tests/Remove-Event.Tests.ps1 b/src/pester-tests/Remove-Event.Tests.ps1 new file mode 100644 index 0000000000..cd44741e8a --- /dev/null +++ b/src/pester-tests/Remove-Event.Tests.ps1 @@ -0,0 +1,38 @@ +Describe "Remove-Event" { + + BeforeEach{ + New-Event -sourceidentifier PesterTimer -sender windows.timer -messagedata "PesterTestMessage" + } + + AfterEach{ + Remove-Event -sourceidentifier PesterTimer -ErrorAction SilentlyContinue + } + + Context "Check Remove-Event can validly remove events" { + + It "Should remove an event given a sourceidentifier" { + { Remove-Event -sourceidentifier PesterTimer } + { Get-Event -ErrorAction SilentlyContinue | Should Not Contain PesterTimer } + } + + It "Should remove an event given an event identifier" { + { $events = Get-Event -sourceidentifier PesterTimer } + { $events = $events.EventIdentifier } + { Remove-Event -EventIdentifier $events } + { $events = Get-Event -ErrorAction SilentlyContinue} + { $events.SourceIdentifier | Should Not Contain "PesterTimer" } + } + + It "Should be able to remove an event given a pipe from Get-Event" { + { Get-Event -sourceidentifier PesterTimer | Remove-Event } + { Get-Event -ErrorAction SilentlyContinue | Should Not Contain "PesterTimer" } + + } + + It "Should NOT remove an event given the whatif flag" { + { Remove-Event -sourceidentifier PesterTimer -whatif } + { $events = Get-Event } + { $events.SourceIdentifier | Should Contain "PesterTimer" } + } + } +} From 909a993a628646e2d452939dfbd4df38a264bbb1 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:23:31 +0000 Subject: [PATCH 09/16] Added pester tests for Start-Sleep --- src/pester-tests/Start-Sleep.Tests.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/pester-tests/Start-Sleep.Tests.ps1 diff --git a/src/pester-tests/Start-Sleep.Tests.ps1 b/src/pester-tests/Start-Sleep.Tests.ps1 new file mode 100644 index 0000000000..afb5f34842 --- /dev/null +++ b/src/pester-tests/Start-Sleep.Tests.ps1 @@ -0,0 +1,14 @@ +Describe "Start-Sleep" { + + Context "Validate Start-Sleep works properly" { + It "Should only sleep for at least 3 seconds"{ + $result = Measure-Command { Start-Sleep -s 3 } + $result.Seconds | Should BeGreaterThan 3 + } + + It "Should sleep for at least 3 seconds using the alias" { + $result = Measure-Command { sleep -s 3 } + $result.Seconds | Should BeGreaterThan 3 + } + } +} From e880aa58a6c3fe7a97790462ab9e2532e2cfd35a Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:23:45 +0000 Subject: [PATCH 10/16] Added pester tests for Tee-Object --- src/pester-tests/Tee-Object.Tests.ps1 | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/pester-tests/Tee-Object.Tests.ps1 diff --git a/src/pester-tests/Tee-Object.Tests.ps1 b/src/pester-tests/Tee-Object.Tests.ps1 new file mode 100644 index 0000000000..1fd926b4ac --- /dev/null +++ b/src/pester-tests/Tee-Object.Tests.ps1 @@ -0,0 +1,35 @@ +$here = Split-Path -Parent $MyInvocation.MyCommand.Path + +Describe "Tee-Object" { + + Context "Validate Tee-Object is correctly forking output" { + + It "Should return the output to the screen and to the variable" { + $teefile = "$here/assets/testfile.txt" + echo teeobjecttest1 | Tee-Object -variable teeresults + $teeresults | Should Be "teeobjecttest1" + Remove-Item $teefile -ErrorAction SilentlyContinue + } + + It "Should return the output to the screen and to the variable from the alias" { + $teefile = "$here/assets/testfile.txt" + echo teeobjecttest2 | tee -variable teeresults + $teeresults | Should Be "teeobjecttest2" + Remove-Item $teefile -ErrorAction SilentlyContinue + } + + It "Should tee the output to a file" { + $teefile = "$here/assets/testfile.txt" + echo teeobjecttest3 | Tee-Object $teefile + Get-Content $teefile | Should Be "teeobjecttest3" + Remove-Item $teefile -ErrorAction SilentlyContinue + } + + It "Should tee the output to a file using the alias" { + $teefile = "$here/assets/testfile.txt" + echo teeobjecttest4 | tee $teefile + Get-Content $teefile | Should Be "teeobjecttest4" + Remove-item $teefile -ErrorAction SilentlyContinue + } + } +} From b5839aa70eef4c139ee4d0d7392463613931e56b Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:24:04 +0000 Subject: [PATCH 11/16] Added pester tests for Update-FormatData --- src/pester-tests/Update-FormatData.Tests.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/pester-tests/Update-FormatData.Tests.ps1 diff --git a/src/pester-tests/Update-FormatData.Tests.ps1 b/src/pester-tests/Update-FormatData.Tests.ps1 new file mode 100644 index 0000000000..f8c522050c --- /dev/null +++ b/src/pester-tests/Update-FormatData.Tests.ps1 @@ -0,0 +1,15 @@ +Describe "Update-FormatData" { + + Context "Validate Update-FormatData update correctly" { + + It "Should not throw upon reloading previous formatting file" { + { Update-FormatData } | Should Not throw + } + + It "Should validly load formatting data" { + { Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path "outputfile.ps1xml" } + { Update-FormatData -prependPath "outputfile.ps1xml" | Should Not throw } + { Remove-Item "outputfile.ps1xml" -ErrorAction SilentlyContinue } + } + } +} From f908daebfbae3267e4c3484cc5930e7ae5e8d070 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:24:28 +0000 Subject: [PATCH 12/16] Added pester tests for Update-TypeData --- src/pester-tests/Update-TypeData.Tests.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/pester-tests/Update-TypeData.Tests.ps1 diff --git a/src/pester-tests/Update-TypeData.Tests.ps1 b/src/pester-tests/Update-TypeData.Tests.ps1 new file mode 100644 index 0000000000..611e88d151 --- /dev/null +++ b/src/pester-tests/Update-TypeData.Tests.ps1 @@ -0,0 +1,15 @@ +Describe "Update-TypeData" { + + Context "Validate Update-Type updates correctly" { + + It "Should not throw upon reloading previous formatting file" { + { Update-TypeData } | Should Not throw + } + + It "Should validly load formatting data" { + { Get-TypeData -typename System.Diagnostics.Process | Export-TypeData -Path "outputfile.ps1xml" } + { Update-TypeData -prependPath "outputfile.ps1xml" | Should Not throw } + { Remove-Item "outputfile.ps1xml" -ErrorAction SilentlyContinue } + } + } +} From 0147d108a2f74f8dcc386a24165df6b02b3e3089 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:24:42 +0000 Subject: [PATCH 13/16] Added pester tests for Wait-Event --- src/pester-tests/Wait-Event.Tests.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/pester-tests/Wait-Event.Tests.ps1 diff --git a/src/pester-tests/Wait-Event.Tests.ps1 b/src/pester-tests/Wait-Event.Tests.ps1 new file mode 100644 index 0000000000..99cbefee15 --- /dev/null +++ b/src/pester-tests/Wait-Event.Tests.ps1 @@ -0,0 +1,9 @@ +Describe "Wait-Event" { + + Context "Validate Wait-Event is waiting for events" { + It "Should verify Wait-Event is waiting for at least a second" { + $waiteventtime = Measure-Command { Wait-Event -timeout 1 } + $waiteventtime.Seconds | Should BeGreaterThan 0 + } + } +} From 2665ee6e5d588532fba1856933b4fe82b48b5d10 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:36:13 +0000 Subject: [PATCH 14/16] minor logic change to Start-Sleep pester test --- src/pester-tests/Start-Sleep.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pester-tests/Start-Sleep.Tests.ps1 b/src/pester-tests/Start-Sleep.Tests.ps1 index afb5f34842..43fede7698 100644 --- a/src/pester-tests/Start-Sleep.Tests.ps1 +++ b/src/pester-tests/Start-Sleep.Tests.ps1 @@ -3,12 +3,12 @@ Describe "Start-Sleep" { Context "Validate Start-Sleep works properly" { It "Should only sleep for at least 3 seconds"{ $result = Measure-Command { Start-Sleep -s 3 } - $result.Seconds | Should BeGreaterThan 3 + $result.Seconds | Should BeGreaterThan 2 } It "Should sleep for at least 3 seconds using the alias" { $result = Measure-Command { sleep -s 3 } - $result.Seconds | Should BeGreaterThan 3 + $result.Seconds | Should BeGreaterThan 2 } } } From 0055b570077ca4f8e49e274587588aae8991d6b8 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:45:49 +0000 Subject: [PATCH 15/16] Added file used for pester testing Import-Alias --- src/pester-tests/assets/pesteralias.txt | Bin 0 -> 270 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 src/pester-tests/assets/pesteralias.txt diff --git a/src/pester-tests/assets/pesteralias.txt b/src/pester-tests/assets/pesteralias.txt new file mode 100755 index 0000000000000000000000000000000000000000..e375d15fec970bd94e2982820c3abf64c625ec73 GIT binary patch literal 270 zcmY+8%L>9U5Jm60Us39|pcM+zo%mR~>JLN>D702mTk6lNCrLLFCd}N&-1&YMO0`v^ zyNr7JBV8k_M4mZl(o>zBUSL;{v)=p_WrA*+m3wBdS*m73OBYqOZW{3SxDDPMywIBe z#NH8I%T9|T1zo|Fp)1HJc@@}Z&e-8-xn~GT-VyI`x{xx$CCcC}Y5o>Rd8Px+ssAZr K{)z`ohW7`MEh;wv literal 0 HcmV?d00001 From f86b37a7610c1ec07d009ee78672de438562b6af Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 19 Nov 2015 06:46:30 +0000 Subject: [PATCH 16/16] Minor whitespace edits to Import-Alias and Measure-Command --- src/pester-tests/Import-Alias.Tests.ps1 | 6 ++---- src/pester-tests/Measure-Command.Tests.ps1 | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pester-tests/Import-Alias.Tests.ps1 b/src/pester-tests/Import-Alias.Tests.ps1 index b29c996e2a..9520146877 100644 --- a/src/pester-tests/Import-Alias.Tests.ps1 +++ b/src/pester-tests/Import-Alias.Tests.ps1 @@ -1,14 +1,12 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path Describe "Import-Alias" { - - #Alias file with only the addition of "pesterecho" aliased to echo $pesteraliasfile = "$here/assets/pesteralias.txt" - + Context "Validate ability to import alias file" { It "Should be able to import an alias file successfully" { - { Import-Alias $pesteraliasfile } | Should Not throw + { Import-Alias $pesteraliasfile } | Should Not throw } It "Should be able to import file via the Import-Alias alias of ipal" { diff --git a/src/pester-tests/Measure-Command.Tests.ps1 b/src/pester-tests/Measure-Command.Tests.ps1 index 77029a322b..16690a1440 100644 --- a/src/pester-tests/Measure-Command.Tests.ps1 +++ b/src/pester-tests/Measure-Command.Tests.ps1 @@ -22,7 +22,7 @@ Describe "Measure-Command" { $testcommand | Add-Content -Path $testfile (Measure-Command { $pesterscript }).GetType() | Should Be timespan - Remove-Item $testfile + Remove-Item $testfile } } }