Title: Stop-Computer, Restart-Computer on macOS: support graceful shutdown by default, implement `-Force` support · Issue #19791 · PowerShell/PowerShell · GitHub
Open Graph Title: Stop-Computer, Restart-Computer on macOS: support graceful shutdown by default, implement `-Force` support · Issue #19791 · PowerShell/PowerShell
X Title: Stop-Computer, Restart-Computer on macOS: support graceful shutdown by default, implement `-Force` support · Issue #19791 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement Note: This would not be a breaking change, because Stop-Computer and Restart-Computer are currently broken altogether on macOS - see #19738 I do not know enough about Linux distros to tell if a di...
Open Graph Description: Summary of the new feature / enhancement Note: This would not be a breaking change, because Stop-Computer and Restart-Computer are currently broken altogether on macOS - see #19738 I do not know en...
X Description: Summary of the new feature / enhancement Note: This would not be a breaking change, because Stop-Computer and Restart-Computer are currently broken altogether on macOS - see #19738 I do not know en...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/19791
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stop-Computer, Restart-Computer on macOS: support graceful shutdown by default, implement `-Force` support","articleBody":"### Summary of the new feature / enhancement\r\n\r\nNote: \r\n\r\n* This would _not_ be a breaking change, because `Stop-Computer` and `Restart-Computer` are currently broken altogether on macOS - see #19738\r\n\r\n* I do not know enough about **Linux** distros to tell if a distinction analogous to the one below is even possible or necessary there. Perhaps the answers [here](https://askubuntu.com/q/187071/225111) provide clues.\r\n\r\n---\r\n\r\nA fix for #19738 is being worked on in #19780, and it will delegate to `/sbin/shutdown -h now` (shutdown) and `/sbin/shutdown -r now` (reboot) on macOS.\r\n\r\nHowever, these commands amount to a _forced_ shutdown: they do not afford GUI applications enough time to shut down gracefully, such as browsers and VM software, inducing potential _data loss_.\r\n\r\nTherefore, I propose the following:\r\n\r\n\r\n### Proposed technical implementation details (optional)\r\n\r\n_By default_, use the following commands on macOS - they _do_ shut down gracefully, but - as on Windows - do not _guarantee_ a shutdown, if an app refuses to quit:\r\n\r\n* Shutdown:\r\n * `osascript -e 'tell application \"System Events\" to shut down'`\r\n* Reboot:\r\n * `osascript -e 'tell application \"System Events\" to restart'`\r\n\r\nUse `/sbin/shutdown` ONLY if `-Force` is specified.\r\n\r\n* Shutdown:\r\n * `/sbin/shutdown -h now`\r\n* Reboot:\r\n * `/sbin/shutdown -r now`\r\n\r\n\r\nNote that the \"graceful\" commands do _not_ require `sudo`, i.e. administrative privileges, whereas `/sbin/shutdown` always does.","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2023-06-13T12:25:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/19791/PowerShell/issues/19791"}
| 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:b2d32a64-926b-56d8-d617-447cec6b1cd0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C93E:1BD726:279E65E:353357F:6A547CE9 |
| html-safe-nonce | 887364bfb2fbf98da81f7083a7970be9410a25616edd9986590df677c4b070ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTNFOjFCRDcyNjoyNzlFNjVFOjM1MzM1N0Y6NkE1NDdDRTkiLCJ2aXNpdG9yX2lkIjoiNjI0MTE4Mzk0MjE2MDE4NjYwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dcc5a2748264d100f79061074198b5c176d259160c0084aa6d27da9e1516a70f |
| hovercard-subject-tag | issue:1754765900 |
| 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/19791/issue_layout |
| twitter:image | https://opengraph.githubassets.com/12a2d55c44c2dbb33f7d85470cfaca733b0c513ba66623f4404248e6e4bd64ef/PowerShell/PowerShell/issues/19791 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/12a2d55c44c2dbb33f7d85470cfaca733b0c513ba66623f4404248e6e4bd64ef/PowerShell/PowerShell/issues/19791 |
| og:image:alt | Summary of the new feature / enhancement Note: This would not be a breaking change, because Stop-Computer and Restart-Computer are currently broken altogether on macOS - see #19738 I do not know en... |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width