Powershell: Missing command alias: iwr

Created on 12 Aug 2016  Â·  4Comments  Â·  Source: PowerShell/PowerShell

The iwr alias is missing in PowerShell Core, although Invoke-WebRequest works perfectly fine. Does this need to be added back?

  • Ubuntu 16.04 LTS base image (Dockerized)
  • .NET Core 1.0.0-preview2
  • PowerShell Core 6.0.0-alpha
PS /powershell> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.8
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

image

Cheers,
Trevor Sullivan
Docker Captain
Microsoft MVP: Cloud & Data Center Management
https://trevorsullivan.net
https://twitter.com/pcgeek86

Issue-Bug WG-DevEx-Portability

Most helpful comment

I ran a quick compare on the difference on the aliases:

CommandType     Name                                               Version    Source                                                            
-----------     ----                                               -------    ------                                                            
Alias           asnp -> Add-PSSnapin                                                                                                            
Alias           CFS -> ConvertFrom-String                          3.1.0.0    Microsoft.PowerShell.Utility                                      
Alias           curl -> Invoke-WebRequest                                                                                                       
Alias           epsn -> Export-PSSession                                                                                                        
Alias           gcb -> Get-Clipboard                               3.1.0.0    Microsoft.PowerShell.Management                                   
Alias           gsnp -> Get-PSSnapin                                                                                                            
Alias           gwmi -> Get-WmiObject                                                                                                           
Alias           ipsn -> Import-PSSession                                                                                                        
Alias           irm -> Invoke-RestMethod                                                                                                        
Alias           ise -> powershell_ise.exe                                                                                                       
Alias           iwmi -> Invoke-WmiMethod                                                                                                        
Alias           iwr -> Invoke-WebRequest                                                                                                        
Alias           lp -> Out-Printer                                                                                                               
Alias           npssc -> New-PSSessionConfigurationFile                                                                                         
Alias           ogv -> Out-GridView                                                                                                             
Alias           rsnp -> Remove-PSSnapin                                                                                                         
Alias           rujb -> Resume-Job                                                                                                              
Alias           rwmi -> Remove-WmiObject                                                                                                        
Alias           scb -> Set-Clipboard                               3.1.0.0    Microsoft.PowerShell.Management                                   
Alias           shcm -> Show-Command                                                                                                            
Alias           sujb -> Suspend-Job                                                                                                             
Alias           swmi -> Set-WmiInstance                                                                                                         
Alias           trcm -> Trace-Command                                                                                                           
Alias           wget -> Invoke-WebRequest                                                                                                       

It seems multiple aliases have been removed. Perhaps this list could be reviewed and the relevant ones could be added back.

All 4 comments

I ran a quick compare on the difference on the aliases:

CommandType     Name                                               Version    Source                                                            
-----------     ----                                               -------    ------                                                            
Alias           asnp -> Add-PSSnapin                                                                                                            
Alias           CFS -> ConvertFrom-String                          3.1.0.0    Microsoft.PowerShell.Utility                                      
Alias           curl -> Invoke-WebRequest                                                                                                       
Alias           epsn -> Export-PSSession                                                                                                        
Alias           gcb -> Get-Clipboard                               3.1.0.0    Microsoft.PowerShell.Management                                   
Alias           gsnp -> Get-PSSnapin                                                                                                            
Alias           gwmi -> Get-WmiObject                                                                                                           
Alias           ipsn -> Import-PSSession                                                                                                        
Alias           irm -> Invoke-RestMethod                                                                                                        
Alias           ise -> powershell_ise.exe                                                                                                       
Alias           iwmi -> Invoke-WmiMethod                                                                                                        
Alias           iwr -> Invoke-WebRequest                                                                                                        
Alias           lp -> Out-Printer                                                                                                               
Alias           npssc -> New-PSSessionConfigurationFile                                                                                         
Alias           ogv -> Out-GridView                                                                                                             
Alias           rsnp -> Remove-PSSnapin                                                                                                         
Alias           rujb -> Resume-Job                                                                                                              
Alias           rwmi -> Remove-WmiObject                                                                                                        
Alias           scb -> Set-Clipboard                               3.1.0.0    Microsoft.PowerShell.Management                                   
Alias           shcm -> Show-Command                                                                                                            
Alias           sujb -> Suspend-Job                                                                                                             
Alias           swmi -> Set-WmiInstance                                                                                                         
Alias           trcm -> Trace-Command                                                                                                           
Alias           wget -> Invoke-WebRequest                                                                                                       

It seems multiple aliases have been removed. Perhaps this list could be reviewed and the relevant ones could be added back.

Keep in mind that all of the *nix oriented alias have been removed in order to not conflict with the corresponding native utility. Ditto for the sort alias. IWR must have been an oversight??

Yeah this means that all of us shell-first cross-platform people (like me)
need to be careful about unintended effects. And of course, never ever use
aliases in your scripts. That was important before, but now it's even more
so.

Some of the missing aliases are very obvious when you think about it. If
one trips you up, I recommend a quick which [CMD], and you'll probably
find there's a match in /bin or similar.

On Mon, Aug 15, 2016, 12:02 PM Keith Hill [email protected] wrote:

Keep in mind that all of the *nix oriented alias have been removed in
order to not conflict with the native utility. Ditto for the sort alias.
IWR must have been an oversight??

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/PowerShell/PowerShell/issues/1778#issuecomment-239844775,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABIMrN0D_g8eNMrZlm1qMmc3F8pWc82ks5qgI2ZgaJpZM4JjdhZ
.

Fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aragula12 picture aragula12  Â·  3Comments

JohnLBevan picture JohnLBevan  Â·  3Comments

ajensenwaud picture ajensenwaud  Â·  3Comments

manofspirit picture manofspirit  Â·  3Comments

alx9r picture alx9r  Â·  3Comments