File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed
Microsoft.PowerShell.Management
Microsoft.PowerShell.Utility Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ Subproject commit 1f546b6aaa0893e215e940a14f57c96f56f7eff1
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ Describe "Start-Process" -Tags @("Feature") {
4646 # $process.ProcessName | Should Be "ping"
4747 }
4848
49+ It " Should invoke correct path when used with Path alias argument" {
50+ $process = Start-Process - Path $pingCommand - ArgumentList $pingParam - PassThru - RedirectStandardOutput " $TESTDRIVE /output"
51+
52+ $process.Length | Should Be 1
53+ $process.Id | Should BeGreaterThan 1
54+ }
55+
4956 It " Should wait for command completion if used with Wait argument" {
5057 $process = Start-Process ping - ArgumentList $pingParam - Wait - PassThru - RedirectStandardOutput " $TESTDRIVE /output"
5158 }
@@ -110,7 +117,7 @@ Describe "Start-Process" -Tags @("Feature") {
110117 It " Should be able to use the -WhatIf switch without performing the actual action" {
111118 $pingOutput = Join-Path $TestDrive " pingOutput.txt"
112119 { Start-Process - Wait $pingCommand - ArgumentList $pingParam - RedirectStandardOutput $pingOutput - WhatIf - ErrorAction Stop } | Should Not Throw
113- $pingOutput | Should Not Exist
120+ $pingOutput | Should Not Exist
114121 }
115122
116123 It " Should return null when using -WhatIf switch with -PassThru" {
Original file line number Diff line number Diff line change @@ -35,6 +35,15 @@ Describe "Tee-Object DRT Unit Tests" -Tags "CI" {
3535 $content | Should Be $expected
3636 }
3737
38+ It " Positive File Test with Path parameter alias" {
39+ $expected = " 1" , " 2" , " 3"
40+ $results = $expected | Tee-Object - Path $tempFile
41+ $results.Length | Should be 3
42+ $results | Should Be $expected
43+ $content = Get-Content $tempFile
44+ $content | Should Be $expected
45+ }
46+
3847 It " Positive Variable Test" {
3948 $expected = " 1" , " 2" , " 3"
4049 $varName = " teeObjectTestVar"
Original file line number Diff line number Diff line change @@ -119,6 +119,12 @@ Describe "Trace-Command" -tags "CI" {
119119 Get-Content $filePath - Raw | Should Match ' ParameterBinding Information'
120120 }
121121
122+ It " Trace-Command using Path parameter alias" {
123+ $null = New-Item $filePath - Force
124+ Trace-Command - Name ParameterBinding - Command ' Get-PSDrive' - Path $filePath - Force
125+ Get-Content $filePath - Raw | Should Match ' ParameterBinding Information'
126+ }
127+
122128 It " Trace-Command contains wildcard characters" {
123129 $a = Trace-Command - Name ParameterB* - Command ' get-alias'
124130 $a.count | Should BeGreaterThan 0
You can’t perform that action at this time.
0 commit comments