Backblaze/B2_Command_Line_Tool

How do I properly escape double quotes when running b2 cli in a powershell console?

Closed this issue · 4 comments

Hello everyone! I've reached backblaze support but I wasn't able to get a straight answer just that the cli command works fine in macs but maybe it requires a different approach on windows.

I'm trying to run the specific command:
b2 update-bucket --corsRules '[{"corsRuleName": "downloadFromAnyOriginWithUpload", "allowedOrigins": ["*"], "allowedOperations": ["s3_put"], "maxAgeSeconds": 3600}]' bucketname allPrivate

And I keep getting errors like if the command isn't correctly typed. I tried changing the quotes to all double, all single, double out and single inner but always the same type error issue

I'm using Powershell v7.2.4 running on windows 11

Command
image

Error
image

powershell is removing your " for some reason. You may need to escape it with a \ or something - I don't know powershell well enough to help you with this.

Where do you recommend I run this command on windows?

I was able to run the command using double quotes group in command prompt!

b2-windows.exe update-bucket --corsRules "[{""corsRuleName"": ""downloadFromAnyOriginWithUpload"", ""allowedOrigins"": [""*""], ""allowedOperations"": [""s3_put""], ""maxAgeSeconds"": 3600}]" bucketname allPrivate

This resolved my issues as well, thank you @sweetsoul