Title: Stop-Computer: broken on macOS; suboptimal UX on all Unix-like platforms · Issue #19738 · PowerShell/PowerShell · GitHub
Open Graph Title: Stop-Computer: broken on macOS; suboptimal UX on all Unix-like platforms · Issue #19738 · PowerShell/PowerShell
X Title: Stop-Computer: broken on macOS; suboptimal UX on all Unix-like platforms · Issue #19738 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/19738
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stop-Computer: broken on macOS; suboptimal UX on all Unix-like platforms","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nOn Unix-like platforms, `Stop-Computer` doesn't support arguments and simply invokes `/sbin/shutdown` - ultimately _argument-less_ - see:https://github.com/PowerShell/PowerShell/blob/0355d2f4df6ba3dec123f51475277bbf1fc0b37d/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs#L162\r\n\r\nThis causes `Stop-Computer` to malfunction on macOS, which _requires `-h now`_ in oder to initiate an immediate shutdown, rendering `Stop-Computer` useless on macOS.\r\n\r\n```powershell\r\n# !! Currently doesn't work on macOS.\r\nsudo pwsh -NoProfile -Command Stop-Computer\r\n```\r\n\r\nAs for the suboptimal UX, which applies to all Unix-like platforms:\r\n\r\n* The syntax diagram shows the Windows-only parameters.\r\n\r\n* Tab-completion completes the common parameters (only), even though they are useless.\r\n\r\n* Common parameters are _accepted_, but effectively _ignored_, which is especially treacherous with `-WhatIf`\r\n\r\n* An attempt to pass arguments through to `shutdown` fails, but with a nondescript error message (`A parameter cannot be found`) - a specific message indicating that pass-through arguments aren't supported would be more helpful.\r\n\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\nAn immediate shutdown should be initiated.\r\n\r\n\r\n### Actual behavior\r\n\r\nThe `shutdown` call fails due to missing options and prints its usage message:\r\n\r\n```none\r\nusage: shutdown [-] [-h [-u] [-n] | -r [-n] | -s | -k] time [warning-message ...]\r\n```\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell 7.4.0-preview.3 on macOS 13.3.1\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2023-06-03T17:51:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/19738/PowerShell/issues/19738"}
| 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:5f8e8baa-b67e-52a9-4860-1b6a68b58a4f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA0E:385199:77BEA2:AC4D9C:6A54A88F |
| html-safe-nonce | a2de68813c9b7288bea3ced11d0737baffc2db1b04fb82e91ee873039161ec80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTBFOjM4NTE5OTo3N0JFQTI6QUM0RDlDOjZBNTRBODhGIiwidmlzaXRvcl9pZCI6IjM0MDc1MjQwMDA5ODUwMzI4NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 02af54c2b52433501b2c167d62e8b4236c912836e8be04211517cb536d07298c |
| hovercard-subject-tag | issue:1739711881 |
| 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/19738/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db8b069af8b3b9f49325c78712776c26d34d04df4c41ca1fbc8ea83115edd416/PowerShell/PowerShell/issues/19738 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db8b069af8b3b9f49325c78712776c26d34d04df4c41ca1fbc8ea83115edd416/PowerShell/PowerShell/issues/19738 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width