github.com/kikitux/packer@v0.10.1-0.20160322154024-6237df566f9f/website/source/docs/provisioners/windows-shell.html.md (about) 1 --- 2 description: | 3 The windows-shell Packer provisioner runs commands on Windows using the cmd 4 shell. 5 layout: docs 6 page_title: Windows Shell Provisioner 7 ... 8 9 # Windows Shell Provisioner 10 11 Type: `windows-shell` 12 13 The windows-shell Packer provisioner runs commands on a Windows machine using 14 `cmd`. It assumes it is running over WinRM. 15 16 ## Basic Example 17 18 The example below is fully functional. 19 20 ``` {.javascript} 21 { 22 "type": "windows-shell", 23 "inline": ["dir c:\\"] 24 } 25 ``` 26 27 ## Configuration Reference 28 29 The reference of available configuration options is listed below. The only 30 required element is either "inline" or "script". Every other option is optional. 31 32 Exactly *one* of the following is required: 33 34 - `inline` (array of strings) - This is an array of commands to execute. The 35 commands are concatenated by newlines and turned into a single file, so they 36 are all executed within the same context. This allows you to change 37 directories in one command and use something in the directory in the next 38 and so on. Inline scripts are the easiest way to pull off simple tasks 39 within the machine. 40 41 - `script` (string) - The path to a script to upload and execute in 42 the machine. This path can be absolute or relative. If it is relative, it is 43 relative to the working directory when Packer is executed. 44 45 - `scripts` (array of strings) - An array of scripts to execute. The scripts 46 will be uploaded and executed in the order specified. Each script is 47 executed in isolation, so state such as variables from one script won't 48 carry on to the next. 49 50 Optional parameters: 51 52 - `binary` (boolean) - If true, specifies that the script(s) are binary files, 53 and Packer should therefore not convert Windows line endings to Unix line 54 endings (if there are any). By default this is false. 55 56 - `environment_vars` (array of strings) - An array of key/value pairs to 57 inject prior to the execute\_command. The format should be `key=value`. 58 Packer injects some environmental variables by default into the environment, 59 as well, which are covered in the section below. 60 61 - `execute_command` (string) - The command to use to execute the script. By 62 default this is `{{ .Vars }}"{{ .Path }}"`. The value of this is treated as 63 [configuration template](/docs/templates/configuration-templates.html). 64 There are two available variables: `Path`, which is the path to the script 65 to run, and `Vars`, which is the list of `environment_vars`, if configured. 66 67 - `remote_path` (string) - The path where the script will be uploaded to in 68 the machine. This defaults to "/tmp/script.sh". This value must be a 69 writable location and any parent directories must already exist. 70 71 - `start_retry_timeout` (string) - The amount of time to attempt to *start* 72 the remote process. By default this is "5m" or 5 minutes. This setting 73 exists in order to deal with times when SSH may restart, such as a 74 system reboot. Set this to a higher value if reboots take a longer amount 75 of time.