aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.55k stars 4.13k forks source link

Add PowerShell support for aliases #4285

Open dgomez407 opened 5 years ago

dgomez407 commented 5 years ago

The current alias file syntax supports only bash syntax and is not compatible with Windows. For example, the example provided at https://github.com/awslabs/awscli-aliases define the function 'f' in bash compatible notation. See the below example for the alias 'myip' which would be stored in ~/.aws/cli/alias:

myip =
  !f() {
    dig +short myip.opendns.com @resolver1.opendns.com
  }; f

When executed on a Windows host the following error is seen:

$ aws myip
'f' is not recognized as an internal or external command,
operable program or batch file.

A suggested resolution is in the pull request at https://github.com/aws/aws-cli/pull/4284 where PowerShell is used for the alias external command.

justnance commented 5 years ago

@dgomez407 - This is an interesting feature request. Thanks for posting. I'm marking it as a feature request pending further review and discussion.

github-actions[bot] commented 3 years ago

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.