Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to recognize multiline command #49

Open
tilakmishra opened this issue Apr 12, 2019 · 11 comments
Open

Unable to recognize multiline command #49

tilakmishra opened this issue Apr 12, 2019 · 11 comments
Assignees

Comments

@tilakmishra
Copy link

I am trying to run this below command using VS code but it doesnt recognize muti-line parameter and giving below error saying following arguments are required. However, arguments are passed

How to overcome this? Not sure if this is a bug or something i am missing. Couldn't find any solution after searching so many ways in internet and hence creating this issue. Thanks for helping.
{
"stderr": "ERROR: az storage account create: error: the following arguments are required: --resource-group/-g, --name/-n\r\nusage: az storage account create [-h] [--verbose] [--debug]\r\n [--output {json,jsonc,table,tsv,yaml,none}]\r\n [--query JMESPATH] --resource-group\r\n RESOURCE_GROUP_NAME --name ACCOUNT_NAME\r\n [--sku {Standard_LRS,Standard_GRS,Standard_RAGRS,Standard_ZRS,Premium_LRS,Premium_ZRS}]\r\n [--location LOCATION]\r\n [--kind {Storage,StorageV2,BlobStorage,FileStorage,BlockBlobStorage}]\r\n [--tags [TAGS [TAGS ...]]]\r\n [--custom-domain CUSTOM_DOMAIN]\r\n [--encryption-services {blob,file,table,queue} [{blob,file,table,queue} ...]]\r\n [--access-tier {Hot,Cool}]\r\n [--https-only [{true,false}]]\r\n [--bypass {None,Logging,Metrics,AzureServices} [{None,Logging,Metrics,AzureServices} ...]]\r\n [--default-action {Allow,Deny}]\r\n [--assign-identity]\r\n [--subscription _SUBSCRIPTION]\r\n",
"stdout": ""
}

az storage account create
--name storagequickstart
--resource-group storage-quickstart-resource-group
--location westus
--sku Standard_LRS
--kind StorageV2

@sbhuttan
Copy link

sbhuttan commented Sep 26, 2019

Any updates on this issue? Multiline statements still do not seem to work.

@chrmarti
Copy link
Contributor

It doesn't work when running the command in the background with the results shown in a side-by-side editor.

It does work when you put a \ at the end of all but the last line and use Run Selected Text in Active Terminal.

@sbhuttan
Copy link

sbhuttan commented Oct 4, 2019

I am seeing same behavior on the Terminal. Each line runs individually. I used "Run Selected Text in Active Terminal" as suggested.

image

@chrmarti
Copy link
Contributor

chrmarti commented Oct 5, 2019

The line continuation character for PowerShell is `, not \. I missed you are using PowerShell.

@mataralhawiti
Copy link

I am seeing same behavior on the Terminal. Each line runs individually. I used "Run Selected Text in Active Terminal" as suggested.

image

I've having the same issue.

@chrmarti
Copy link
Contributor

chrmarti commented Jan 6, 2020

@mataralhawiti Are you using PowerShell or some Unix shell? Note that PowerShell uses ` (backtick) at the end of each but the last line. Unix shells use \ (backslash).

@mataralhawiti
Copy link

mataralhawiti commented Jan 6, 2020

@mataralhawiti Are you using PowerShell or some Unix shell? Note that PowerShell uses (backtick) at the end of each but the last line. Unix shells use` (backslash).

I'm using the vs code (run line in terminal ) - windows machine

here's my code :

az group create --location westeurope\
--name rg_playground2\
--tags owner:'Matar' for:airflow'

The error :

--name rg_playground2
'--name' is not recognized as an internal or external command,
operable program or batch file.

@chrmarti
Copy link
Contributor

chrmarti commented Jan 7, 2020

If you are using PowerShell in the terminal you need to replace the backslashes with backticks. If you are using CMD you need to replace the backslashes with carets (^). The different shells have different line continuation characters.

@mataralhawiti
Copy link

thanks it works now

@ivanakcheurov
Copy link

ivanakcheurov commented Aug 6, 2020

Hi, I have the following command that is not working in Powershell 7.0.3 (Windows10, Visual Studio Code terminal).

az role definition update --role-definition '{ `
   "Name": "Custom Network Contributor Role", `
   "IsCustom": true, `
   "Description": "Can do operations on NICs and join subnets", `
   "Actions": [ `
     "*/read", `
   ], `
   "NotActions": [], `
   "DataActions": [], `
   "NotDataActions": [], `
   "AssignableScopes": [ `
     "/subscriptions/---guid---", `
     "/subscriptions/---another-guid---" `
   ] `
 }'

I get the following error:
Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
I tried with backticks, backslashes, with and without single quotes. Nothing works.

@AndreyTomilinXmpi
Copy link

Same for me: the ` does not work with PowerShell 7.3.0, but works with previous versions.
Welcome to the world of Microsoft standards and backward compatibility!
Some things never change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants