Skip to content

Using postpositional & (control operator) rather than Start-Job results in different current location (working directory) #4267

@mklement0

Description

@mklement0

Steps to reproduce

Set-Location /

$j = $pwd & Receive-Job -AutoRemoveJob -Wait $j

$j = Start-Job { $pwd }; Receive-Job -AutoRemoveJob -Wait $j

Expected behavior

/    # on Windows: C:\
/

Actual behavior

/
/home/jdoe   # on Linux; on macOS: /User/jdoe; on Windows: C:\Users\jdoe\Documents

Environment data

PowerShell Core v6.0.0-beta.4 on macOS 10.12.5
PowerShell Core v6.0.0-beta.4 on Ubuntu 16.04.2 LTS
PowerShell Core v6.0.0-beta.4 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions