0

Need to create a powershell script for deployment of alexa skill and lambda function. Need a solution to provide dynamic input form a JSON file to powershell after executing the following command:

ask api --skill-id xxxxxxxxxxxxxxxxx create-account-linking

ask-cli command

I need to pass the parameters like

? Authorization URL:  https://www.google.com/
? Client ID:
? Scopes(separate by comma):
? Domains(separate by comma):
? Authorization Grant Type:  AUTH_CODE
? Access Token URI:
? Client Secret:  [hidden]
? Client Authentication Scheme:  HTTP_BASIC
? Optional* Default Access Token Expiration Time In Seconds:

from the JSON file dynamically.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Akshay
  • 1
  • 1
  • `ask` seems to be doing nothing interesting but create a JSON request under the covers. You should be able to do the same thing directly using `Invoke-RestMethod`, bypassing `ask` entirely. You do need to know the format of the requests, though (and possibly how authorization works) but this is something that should be well documented and supported for any client framework, not just PowerShell. – Jeroen Mostert Jun 11 '18 at 13:01
  • @Jeroen Mostert Thanks for guiding, but ask initially registers the user profile by making user sign up to the amazon developer portal by command prompt using 'ask init' command. As amazon has not provided the open API's for accounting linking we are only left with the option to pass those parameters.It seems I need to find any possible way in powershell to pass the parameters to the interactive commands from the file. – Akshay Jun 12 '18 at 05:54
  • Have you already tried simply piping standard input to it (i.e. `echo "https://www.google.com/" | ask ...`)? If that works you can supply input by cobbling together a string with newlines. – Jeroen Mostert Jun 12 '18 at 07:07

0 Answers0