Skip to content

Commit

Permalink
Remove sc alias which conflicts with sc.exe (#5827)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT authored and daxian-dbw committed Jan 9, 2018
1 parent d6288a3 commit 0d893a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4639,7 +4639,6 @@ internal static SessionStateAliasEntry[] BuiltInAliases
new SessionStateAliasEntry("rvpa", "Resolve-Path", "", ReadOnly),
new SessionStateAliasEntry("sal", "Set-Alias", "", ReadOnly),
new SessionStateAliasEntry("sbp", "Set-PSBreakpoint", "", ReadOnly),
new SessionStateAliasEntry("sc", "Set-Content", "", ReadOnly),
new SessionStateAliasEntry("select", "Select-Object", "", ReadOnly_AllScope),
new SessionStateAliasEntry("si", "Set-Item", "", ReadOnly),
new SessionStateAliasEntry("sl", "Set-Location", "", ReadOnly),
Expand Down Expand Up @@ -4688,13 +4687,14 @@ internal static SessionStateAliasEntry[] BuiltInAliases
new SessionStateAliasEntry("type", "Get-Content"),
// Native commands we keep because the functions act correctly on Linux
new SessionStateAliasEntry("clear", "Clear-Host"),
//#if !CORECLR is used to disable aliases for cmdlets which are not available on OneCore
//#if !CORECLR is used to disable aliases for cmdlets which are not available on OneCore or not appropriate for PSCore6 due to conflicts
#if !CORECLR
new SessionStateAliasEntry("gwmi", "Get-WmiObject", "", ReadOnly),
new SessionStateAliasEntry("iwmi", "Invoke-WMIMethod", "", ReadOnly),
new SessionStateAliasEntry("ogv", "Out-GridView", "", ReadOnly),
new SessionStateAliasEntry("ise", "powershell_ise.exe", "", ReadOnly),
new SessionStateAliasEntry("rwmi", "Remove-WMIObject", "", ReadOnly),
new SessionStateAliasEntry("sc", "Set-Content", "", ReadOnly),
new SessionStateAliasEntry("swmi", "Set-WMIInstance", "", ReadOnly),
new SessionStateAliasEntry("shcm", "Show-Command", "", ReadOnly),
new SessionStateAliasEntry("trcm", "Trace-Command", "", ReadOnly),
Expand Down
2 changes: 1 addition & 1 deletion test/powershell/engine/Basic/DefaultCommands.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Alias", "saps", "Start-Process", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", ""
"Alias", "sasv", "Start-Service", $($FullCLR -or $CoreWindows ), "ReadOnly", ""
"Alias", "sbp", "Set-PSBreakpoint", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", ""
"Alias", "sc", "Set-Content", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", ""
"Alias", "sc", "Set-Content", $($FullCLR ), "ReadOnly", ""
"Alias", "scb", "Set-Clipboard", $($FullCLR ), "ReadOnly", ""
"Alias", "select", "Select-Object", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "AllScope"
"Alias", "set", "Set-Variable", $($FullCLR -or $CoreWindows -or $CoreUnix), "", ""
Expand Down

0 comments on commit 0d893a5

Please sign in to comment.