{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/16","repository_url":"https://api.github.com/repos/PowerShell/PowerShell-RFC","labels_url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/16/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/16/events","html_url":"https://github.com/PowerShell/PowerShell-RFC/issues/16","id":173254574,"number":16,"title":"Weak-Aliases comments","user":{"login":"lzybkr","id":2148248,"avatar_url":"https://avatars.githubusercontent.com/u/2148248?v=3","gravatar_id":"","url":"https://api.github.com/users/lzybkr","html_url":"https://github.com/lzybkr","followers_url":"https://api.github.com/users/lzybkr/followers","following_url":"https://api.github.com/users/lzybkr/following{/other_user}","gists_url":"https://api.github.com/users/lzybkr/gists{/gist_id}","starred_url":"https://api.github.com/users/lzybkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzybkr/subscriptions","organizations_url":"https://api.github.com/users/lzybkr/orgs","repos_url":"https://api.github.com/users/lzybkr/repos","events_url":"https://api.github.com/users/lzybkr/events{/privacy}","received_events_url":"https://api.github.com/users/lzybkr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":83,"created_at":"2016-08-25T16:47:33Z","updated_at":"2016-08-26T16:03:16Z","closed_at":null,"body":"This issue is to discuss the weak aliases RFC.\r\n\r\nThis proposal helps address issues related to the `curl`/`wget` aliases introduced in PowerShell V3.\r\n\r\nThe discussion should focus on the strengths and weaknesses of this specific proposal and on avoiding or minimizing breaking changes. Ideally, existing scripts should continue to run **without any changes** when a new version of Windows PowerShell is installed.\r\n\r\nNote that doing nothing is the only way to completely avoid breaking changes - the goal of this RFC is to find a compromise.\r\n\r\nThis RFC does propose a breaking change, but only in scripts where `curl` and `wget` are meant to call `Invoke-WebRequest` but `curl.exe` or `wget.exe` are found via the path. We don't have data on how often this might be an issue - but if a future version of Windows installs `curl.exe` and `wget.exe` by default, then it may be pointless to implement this RFC as that would be equivalent to removing the aliases."},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/comments/242777028","html_url":"https://github.com/PowerShell/PowerShell-RFC/issues/16#issuecomment-242777028","issue_url":"https://api.github.com/repos/PowerShell/PowerShell-RFC/issues/16","id":242777028,"user":{"login":"kilasuit","id":6355225,"avatar_url":"https://avatars.githubusercontent.com/u/6355225?v=3","gravatar_id":"","url":"https://api.github.com/users/kilasuit","html_url":"https://github.com/kilasuit","followers_url":"https://api.github.com/users/kilasuit/followers","following_url":"https://api.github.com/users/kilasuit/following{/other_user}","gists_url":"https://api.github.com/users/kilasuit/gists{/gist_id}","starred_url":"https://api.github.com/users/kilasuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kilasuit/subscriptions","organizations_url":"https://api.github.com/users/kilasuit/orgs","repos_url":"https://api.github.com/users/kilasuit/repos","events_url":"https://api.github.com/users/kilasuit/events{/privacy}","received_events_url":"https://api.github.com/users/kilasuit/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T16:03:16Z","updated_at":"2016-08-26T16:03:16Z","body":"The problem with removing the curl alias or applying the suggested Weak attribute is that if you take the last example in the help for Invoke-WebRequest and run this on a system the has had curl installed like @dlwyatt mentioned then the example\r\n\r\n```powershell \r\nInvoke-WebRequest -Uri \"http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx\"\r\n```\r\n breaks if you change this to curl after removing the alias like so\r\n```powershell\r\nRemove-Item Alias:\\curl\r\ncurl -Uri \"http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx\"\r\n```\r\nas it doesn't output in the same way.\r\n\r\nWe in the PowerShell Community have long taught that the golden 3 rules for discoverability are always\r\n\r\nGet-Command\r\nGet-Help\r\nGet-Member\r\n\r\nand alongside that its also widely taught that Aliases are not for use in scripts - yet we still see people that use them and defend using them in their scripts.\r\n\r\nI've also seen organisations roll out to all their servers a $PROFILE.AllUsersAllHosts that removes all aliases \r\n\r\nI'm afraid that anyway we go will be a breaking change however that being said I think that we need to do a combination of things to resolve this.\r\n\r\n\r\n- Introduce the notion of Weak / Deprecated aliases\r\n- Add Warning Output when these are used\r\n- Add a New Event Log warning entry detailing that a Weak/Deprecated alias has been used (thinking this may help find scripts that people have forgotten about)\r\n- Add a new PSScriptAnalyzer rule for these aliases\r\n- Try and deliver an auto script fixer for these aliases"}}
{"actor":{"display_login":"kilasuit"}}