Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Jan 8, 2018

PR Summary

SC is a default alias for Set-Content, however on Windows there is a sc.exe command for managing NT Services.
If a user executes sc start service1 in a PowerShell script, what happens is that a file called start is created containing service1 as the content with no error so the user/script may think the service got started.
In addition, there is also a sc command on Linux, although it's not installed by default.
If the customer feedback is that we should not have removed this, it'll be easier to add it back in 6.1.0 than to ever try to remove it after 6.0.0.

Fix is to remove sc alias from InitialSessionState and corresponding test case.
This was discussed with some members of @PowerShell/powershell-committee whom agreed to the removal.

Doc change MicrosoftDocs/PowerShell-Docs#2021

Fix #3980

PR Checklist

Note: Please mark anything not applicable to this PR NA.

@SteveL-MSFT SteveL-MSFT added the Breaking-Change breaking change that may affect users label Jan 8, 2018
@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-GA milestone Jan 8, 2018
@SteveL-MSFT SteveL-MSFT requested a review from daxian-dbw January 8, 2018 23:54
Copy link
Member

Choose a reason for hiding this comment

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

Windows PowerShell only aliases are also included here so this table is a complete source of alias changes. So maybe this entry should be kept and only change the 4th column to be $($FullCLR ) like scb.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'll make that change until we completely remove the Windows PowerShell code :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@daxian-dbw daxian-dbw merged commit 0d893a5 into PowerShell:master Jan 9, 2018
@SteveL-MSFT SteveL-MSFT deleted the remove-sc branch January 9, 2018 01:21
TravisEz13 pushed a commit to TravisEz13/PowerShell that referenced this pull request Jan 9, 2018
@TravisEz13 TravisEz13 mentioned this pull request Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sc start "my service" returns nothing and doesnt start services

3 participants