Skip to content

Conversation

@brendandburns
Copy link
Contributor

@brendandburns brendandburns commented Nov 22, 2019

PR Summary

Adds an implementation of the Stop-Computer cmdlet for Linux and OS X

PR Context

Closes #5448

PR Checklist

@brendandburns
Copy link
Contributor Author

I'm pretty sure the Windows CI run is a flake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't prevent cross compilation. Pass in the property from the build.psm1. You can then default the property if it is not set from the commandline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

<IsWindows Condition="'$(IsWindows)' =='true' or ( '$(IsWindows)' == '' and '$(OS)' == 'Windows_NT')">true</IsWindows>

$Arguments += "/property:IsWindows=true"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed to be a runtime thing.

Copy link
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 22, 2019
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason start-process won't work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean the C# Process class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here is an example:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-P is not an option on the macOS shutdown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we handle it when the user doesn't have permissions to shutdown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command will error out and we (now) write the error code to the stream.

@TravisEz13 TravisEz13 self-assigned this Nov 22, 2019
@TravisEz13
Copy link
Member

@brendandburns I had the CI system rerun the flaky tests and filed: #11168

Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I would like to see Restart-Computer also be enabled for non-Windows platforms.

@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 25, 2019
@brendandburns brendandburns force-pushed the stop branch 5 times, most recently from 8afdfc1 to 1be3fb8 Compare November 25, 2019 21:35
@brendandburns
Copy link
Contributor Author

Comments addressed, please re-check.

@brendandburns brendandburns force-pushed the stop branch 2 times, most recently from 90c6695 to 919fc84 Compare November 25, 2019 22:02
@brendandburns
Copy link
Contributor Author

comments addressed, please take another look.

Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 26, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 27, 2019
@brendandburns
Copy link
Contributor Author

@SteveL-MSFT comments addressed, please take another look.

Thanks!

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brendandburns
Copy link
Contributor Author

@TravisEz13 any chance you can take another look here, I'd love to see this merged since I have a follow up PR to share once it is merged.

@TravisEz13
Copy link
Member

@brendandburns Sorry, I've been out of the office.

@TravisEz13 TravisEz13 added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 3, 2019
@TravisEz13 TravisEz13 added this to the 7.1.0-preview.1 milestone Dec 3, 2019
@TravisEz13 TravisEz13 changed the title Add an implementation of Stop-Computer for Linux and OS X. Add an implementation of Stop-Computer for Linux and macOS Dec 3, 2019
@TravisEz13 TravisEz13 merged commit d38541f into PowerShell:master Dec 3, 2019
@ghost
Copy link

ghost commented Mar 26, 2020

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Stop-Computer cmdlet

4 participants