GeezerVison is showing github.com — Remove sc alias which conflicts with sc.exe (#5827) · PowerShell/PowerShell@0d893a5
File treeExpand file treeCollapse file tree Open diff view settings src/System.Management.Automation/engine test/powershell/engine/Basic
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/System.Management.Automation/engine/InitialSessionState.cs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4639,7 +4639,6 @@ internal static SessionStateAliasEntry[] BuiltInAliases | 4639 | 4639 | new SessionStateAliasEntry("rvpa", "Resolve-Path", "", ReadOnly), | 4640 | 4640 | new SessionStateAliasEntry("sal", "Set-Alias", "", ReadOnly), | 4641 | 4641 | new SessionStateAliasEntry("sbp", "Set-PSBreakpoint", "", ReadOnly), | 4642 | | - new SessionStateAliasEntry("sc", "Set-Content", "", ReadOnly), | 4643 | 4642 | new SessionStateAliasEntry("select", "Select-Object", "", ReadOnly_AllScope), | 4644 | 4643 | new SessionStateAliasEntry("si", "Set-Item", "", ReadOnly), | 4645 | 4644 | new SessionStateAliasEntry("sl", "Set-Location", "", ReadOnly), | @@ -4688,13 +4687,14 @@ internal static SessionStateAliasEntry[] BuiltInAliases | 4688 | 4687 | new SessionStateAliasEntry("type", "Get-Content"), | 4689 | 4688 | // Native commands we keep because the functions act correctly on Linux | 4690 | 4689 | new SessionStateAliasEntry("clear", "Clear-Host"), | 4691 | | -//#if !CORECLR is used to disable aliases for cmdlets which are not available on OneCore | | 4690 | +//#if !CORECLR is used to disable aliases for cmdlets which are not available on OneCore or not appropriate for PSCore6 due to conflicts | 4692 | 4691 | #if !CORECLR | 4693 | 4692 | new SessionStateAliasEntry("gwmi", "Get-WmiObject", "", ReadOnly), | 4694 | 4693 | new SessionStateAliasEntry("iwmi", "Invoke-WMIMethod", "", ReadOnly), | 4695 | 4694 | new SessionStateAliasEntry("ogv", "Out-GridView", "", ReadOnly), | 4696 | 4695 | new SessionStateAliasEntry("ise", "powershell_ise.exe", "", ReadOnly), | 4697 | 4696 | new SessionStateAliasEntry("rwmi", "Remove-WMIObject", "", ReadOnly), | | 4697 | + new SessionStateAliasEntry("sc", "Set-Content", "", ReadOnly), | 4698 | 4698 | new SessionStateAliasEntry("swmi", "Set-WMIInstance", "", ReadOnly), | 4699 | 4699 | new SessionStateAliasEntry("shcm", "Show-Command", "", ReadOnly), | 4700 | 4700 | new SessionStateAliasEntry("trcm", "Trace-Command", "", ReadOnly), | |
Collapse file Copy file name to clipboardExpand all lines: test/powershell/engine/Basic/DefaultCommands.Tests.ps1 +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -143,7 +143,7 @@ Describe "Verify approved aliases list" -Tags "CI" { | 143 | 143 | "Alias", "saps", "Start-Process", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "" | 144 | 144 | "Alias", "sasv", "Start-Service", $($FullCLR -or $CoreWindows ), "ReadOnly", "" | 145 | 145 | "Alias", "sbp", "Set-PSBreakpoint", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "" | 146 | | -"Alias", "sc", "Set-Content", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "" | | 146 | +"Alias", "sc", "Set-Content", $($FullCLR ), "ReadOnly", "" | 147 | 147 | "Alias", "scb", "Set-Clipboard", $($FullCLR ), "ReadOnly", "" | 148 | 148 | "Alias", "select", "Select-Object", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "AllScope" | 149 | 149 | "Alias", "set", "Set-Variable", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "" | |
|