Remove sc alias which conflicts with sc.exe (#5827)

This commit is contained in:
Steve Lee 2018-01-08 17:20:00 -08:00 committed by Travis Plunk
parent 0687d5a564
commit 08c455a4ee
2 changed files with 3 additions and 3 deletions

View file

@ -4639,7 +4639,6 @@ end
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),
@ -4688,13 +4687,14 @@ end
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),

View file

@ -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), "", ""