Title: Start-Job needs a -WorkingDirectory parameter · Issue #4287 · PowerShell/PowerShell · GitHub
Open Graph Title: Start-Job needs a -WorkingDirectory parameter · Issue #4287 · PowerShell/PowerShell
X Title: Start-Job needs a -WorkingDirectory parameter · Issue #4287 · PowerShell/PowerShell
Description: Currently, Start-Job: defaults to different, fixed working directories on different platforms (which is problematic in itself): $HOME on Unix (macOS, Linux) $HOME\Documents on Windows by contrast, using the newly-introduced Unix-like ......
Open Graph Description: Currently, Start-Job: defaults to different, fixed working directories on different platforms (which is problematic in itself): $HOME on Unix (macOS, Linux) $HOME\Documents on Windows by contrast, ...
X Description: Currently, Start-Job: defaults to different, fixed working directories on different platforms (which is problematic in itself): $HOME on Unix (macOS, Linux) $HOME\Documents on Windows by contrast, ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4287
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Start-Job needs a -WorkingDirectory parameter","articleBody":"Currently, `Start-Job`:\r\n\r\n* defaults to _different_, _fixed_ working directories on _different platforms_ (which is problematic in itself):\r\n * `$HOME` on Unix (macOS, Linux)\r\n * `$HOME\\Documents` on Windows\r\n\r\n* by contrast, using the newly-introduced Unix-like `... &` syntax defaults to the _current_ location; this discrepancy is problematic too [_update: but as designed_] - see #4267\r\n\r\nEither way, there is **no simple way to have the _caller_ set the working directory _explicitly_,** leading to such painful workarounds as in [this SO answer](https://stackoverflow.com/a/17388991/45375).\r\n\r\nThe proposed solution:\r\n\r\n```powershell\r\n# Wishful thinking\r\n> $jb = Start-Job -WorkingDirectory $PSHOME { \"Hi from $PWD.\" }; Receive-Job -AutoRemove -Wait $jb\r\nHi from C:\\Program Files\\PowerShell\\6.0.0-beta.4\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core v6.0.0-beta.4 on macOS 10.12.5\r\nPowerShell Core v6.0.0-beta.4 on Ubuntu 16.04.2 LTS\r\nPowerShell Core v6.0.0-beta.4 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\nWindows PowerShell v5.1.15063.413 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-07-18T19:41:46Z","url":"https://github.com/PowerShell/PowerShell/issues/4287"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5e2a85f-4a6e-7946-1fc6-c0c814965da5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEA0:268AD4:5A6E1:7AABB:6AFD48A6 |
| html-safe-nonce | 119cd7b47a153d94a561c2a8b83e3d0144c94b866ad468462489ac23cffc44a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUEwOjI2OEFENDo1QTZFMTo3QUFCQjo2QUZENDhBNiIsInZpc2l0b3JfaWQiOiIxMzU5ODAwNTc5NTU3NDgwMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 94abe09eebd471391d55be76dff6684345d2a7a1c96a5b3436ead948c3b34978 |
| hovercard-subject-tag | issue:243828930 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/4287/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7309ceb3e191f62f137857124dfe09982cd800c3da6a288ce3b8132cccb76c8b/PowerShell/PowerShell/issues/4287 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7309ceb3e191f62f137857124dfe09982cd800c3da6a288ce3b8132cccb76c8b/PowerShell/PowerShell/issues/4287 |
| og:image:alt | Currently, Start-Job: defaults to different, fixed working directories on different platforms (which is problematic in itself): $HOME on Unix (macOS, Linux) $HOME\Documents on Windows by contrast, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width