Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", ""
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

"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