简体   繁体   中英

Windows Command TYPE Keywords in Quotes

I'm trying to pass the TYPE keyword in the Windows command line to read a file and output its contents in a parameter.

I want to read the contents of 'state-machine.json' into my string... with bash I know I can use:

aws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition "$(cat ./step-function/state-machine.json)"

However I can't figure out the Windows equivalent:

aws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition  "@(type ./step-function/state-machine.json)"

Is "@(type ./step-function/state-machine.json)" supposed to be a powershell command?

$StateMachine=gc "path-to\state-machine.json"

aws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition  "@("$StateMachine")"

使用以下解决了我的问题:

create-state-machine --definition file://step-function/state-machine.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM