Skip to content

Refactor and implement Restart-Computer for Un*x and macOS - #11319

Merged
Travis Plunk (TravisEz13) merged 6 commits into
PowerShell:masterfrom
brendandburns:restarter
Feb 3, 2020
Merged

Travis Plunk (TravisEz13) merged 6 commits into
PowerShell:masterfrom
brendandburns:restarter

Conversation

@brendandburns

@brendandburns Brendan Burns (brendandburns) commented Dec 11, 2019 •

Copy link
Copy Markdown
Contributor

PR Summary

Implement the Restart-Computer command for Un*x and MacOS

PR Context

Compliment to the recent implementation of Stop-Computer (#11151)

PR Checklist

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 11, 2019
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Dec 11, 2019
@iSazonov

Copy link
Copy Markdown
Collaborator

Brendan Burns (@brendandburns) Please don't rebase until maintainers ask you. Rebasing complicates reviewing.

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Windows Computer cmdlets already use a test hook for testing, should use the same thing here. See https://github.com/PowerShell/PowerShell/blob/master/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs#L2130

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 11, 2019
@iSazonov

Copy link
Copy Markdown
Collaborator

We merged #11151 without new tests.

@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 11, 2019
@brendandburns

Copy link
Copy Markdown
Contributor Author

I will address comments and add tests for both commands.

Thanks

@brendandburns

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) is there a preferred style of addressing comments for the PowerShell repo? Should I just add additional commits instead of squashing commits?

(I'm new here :)

Thanks

@iSazonov

Copy link
Copy Markdown
Collaborator

Should I just add additional commits instead of squashing commits?

Yes, please add new commits. Some commits or one for all comments.

@SteveL-MSFT

Copy link
Copy Markdown
Member

Brendan Burns (@brendandburns) unless there is a need to preserve history, we always squash on merge. For the sake of the reviewers, it's always been easier to add new commits so we can see what exactly changed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove the commented code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@brendandburns

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) Steve Lee (@SteveL-MSFT)

Sorry it took so long for me to get back to this. I've added tests for both Restart-Computer and Stop-Computer on Unix.

Please take another look.

Thanks!

Comment on lines 31 to 34

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use It "Should support -computer parameter" -Skip:(!$IsWindows) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done for all.

Comment on lines 40 to 43

@iSazonov Ilya (iSazonov) Jan 15, 2020 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same. Below too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done for all.

@brendandburns

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) comments addressed, please re-check.

Thanks!

@iSazonov

Copy link
Copy Markdown
Collaborator

Brendan Burns (@brendandburns) Did you address all Steve Lee (@SteveL-MSFT) 's comments?

@brendandburns

Copy link
Copy Markdown
Contributor Author

yes, I verified in the code that I had addressed both of the comments from Steve Lee (@SteveL-MSFT)

Thanks

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Please update your review.

1 similar comment
@TravisEz13

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Please update your review.

@TravisEz13

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Please update your review

@TravisEz13

Copy link
Copy Markdown
Member

The merge is bad. I'll fix it.

@TravisEz13

Travis Plunk (TravisEz13) commented Feb 3, 2020 •

Copy link
Copy Markdown
Member

Rebased to resolve conflicts and changed #region format to match changes from conflict

@TravisEz13

Copy link
Copy Markdown
Member

PoshChan-Bot (@PoshChan) Please remind me in 1 hour

@PoshChan

Copy link
Copy Markdown
Collaborator

Travis Plunk (@TravisEz13), this is the reminder you requested 1 hour ago

@TravisEz13 Travis Plunk (TravisEz13) changed the title Refactor and implement Restart-Computer for Un*x and MacOS Refactor and implement Restart-Computer for Un*x and macOS Feb 3, 2020
@TravisEz13
Travis Plunk (TravisEz13) merged commit 127fec5 into PowerShell:master Feb 3, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

Brendan Burns (@brendandburns) Thanks for your contribution!

@ghost

Copy link
Copy Markdown

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

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

5 participants