Skip to content

Start-Job -WorkingDirectory only accepts native filesystem paths #11050

@mklement0

Description

@mklement0

This has two ramifications:

  • A path based on a PS drive isn't supported.

    • A note re a possible fix: The child process running the script block cannot be assumed to have the same PS (filesystem) drives defined, but at least a PS-drive-based input path should be resolved to the underlying native path.
  • The interchangeable use of / and \ isn't supported.

Steps to reproduce

New-PSDrive foo filesystem .; Set-Location foo:/

Start-Job { $pwd } -WorkingDirectory $pwd | Receive-Job -Wait -AutoRemove | Should -Match '^foo:[/\\]'

if (-not $IsWindows) {
  Start-Job { $pwd } -WorkingDirectory '\' | Receive-Job -Wait -AutoRemove | Should -Be '/'
}

Expected behavior

Both tests should pass.

Actual behavior

Both tests fail.

Environment data

PowerShell Core 7.0.0-preview.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-Providerspecific to the FileSystem providerIssue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions