Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public string[] LiteralPath
/// The qualifier is the drive or provider that is qualifying
/// the MSH path.
/// </value>
[Parameter(Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = qualifierSet, Mandatory = false)]
[Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = qualifierSet)]
public SwitchParameter Qualifier { get; set; }

/// <summary>
Expand Down Expand Up @@ -476,4 +476,3 @@ private string RemoveQualifier(string path)
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Describe "Split-Path" -Tags "CI" {
{ Split-Path -Qualifier -ErrorAction Stop abcdef } | Should -Throw
}

It "Should error given positional parameter #2" {
{ Split-Path env: $NULL } | Should -Throw -ErrorId 'PositionalParameterNotFound,Microsoft.PowerShell.Commands.SplitPathCommand'
}

It "Should return the path when the noqualifier switch is used" {
Split-Path env:PATH -NoQualifier | Should -BeExactly "PATH"
}
Expand Down