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
Read command to run with Bolt from a file #2125
Comments
Testing this approach in PowerShell proves we can't use
You can use the backtick escape character to get PowerShell to skip using
That suffices the raw Using PowerShell Language features, we could have the cmdlet handle it without using
|
This adds support for reading a command from a file or `stdin` using the `bolt command run` command. To read a command from a file, pass the path to the file with the `@` symbol: ```shell $ bolt command run @script.sh --targets targets ``` The filepath is expanded relative to the current working directory. To read a command from `stdin`, pass a single dash `-` as the command and then pipe the command to Bolt: ```shell $ echo whoami | bolt command run - --targets targets ``` !feature * **Read command from a file or `stdin` using `bolt command run`** ([puppetlabs#2125](puppetlabs#2125)) The `bolt command run` command can now read a command from a file or `stdin`.
This adds support for reading a command from a file or `stdin` using the `bolt command run` command. To read a command from a file, pass the path to the file with the `@` symbol: ```shell $ bolt command run @script.sh --targets targets ``` The filepath is expanded relative to the current working directory. To read a command from `stdin`, pass a single dash `-` as the command and then pipe the command to Bolt: ```shell $ echo whoami | bolt command run - --targets targets ``` !feature * **Read command from a file or `stdin` using `bolt command run`** ([puppetlabs#2125](puppetlabs#2125)) The `bolt command run` command can now read a command from a file or `stdin`.
This adds support for reading a command from a file or `stdin` using the `bolt command run` command. To read a command from a file, pass the path to the file with the `@` symbol: ```shell $ bolt command run @script.sh --targets targets ``` The filepath is expanded relative to the current working directory. To read a command from `stdin`, pass a single dash `-` as the command and then pipe the command to Bolt: ```shell $ echo whoami | bolt command run - --targets targets ``` !feature * **Read command from a file or `stdin` using `bolt command run`** ([puppetlabs#2125](puppetlabs#2125)) The `bolt command run` command can now read a command from a file or `stdin`.
This adds support for reading a command from a file or `stdin` using the `bolt command run` command. To read a command from a file, pass the path to the file with the `@` symbol: ```shell $ bolt command run @script.sh --targets targets ``` The filepath is expanded relative to the current working directory. To read a command from `stdin`, pass a single dash `-` as the command and then pipe the command to Bolt: ```shell $ echo whoami | bolt command run - --targets targets ``` !feature * **Read command from a file or `stdin` using `bolt command run`** ([puppetlabs#2125](puppetlabs#2125)) The `bolt command run` command can now read a command from a file or `stdin`.
(GH-2125) Read command from a file or stdin
This adds support for reading a command from a file or `stdin` using the `bolt command run` command. To read a command from a file, pass the path to the file with the `@` symbol: ```shell $ bolt command run @script.sh --targets targets ``` The filepath is expanded relative to the current working directory. To read a command from `stdin`, pass a single dash `-` as the command and then pipe the command to Bolt: ```shell $ echo whoami | bolt command run - --targets targets ``` !feature * **Read command from a file or `stdin` using `bolt command run`** ([puppetlabs#2125](puppetlabs#2125)) The `bolt command run` command can now read a command from a file or `stdin`.
Use Case
On certain systems, particularly network devices, files can't be written and therefore
bolt script run
doesn't work. In that case, it's useful to be able to run a long, multi-line script as a command.Describe the Solution You Would Like
bolt command run @file.txt
should read the command run a file namedfile.txt
. If the file doesn't exist or can't be read, it should error.The text was updated successfully, but these errors were encountered: