mirror of https://github.com/docker/docs.git
				
				
				
			Merge pull request #2659 from dgageot/powershell-env
Fix Powershell env hints
This commit is contained in:
		
						commit
						1976613fa8
					
				|  | @ -238,7 +238,7 @@ func (g *EnvUsageHintGenerator) GenerateUsageHint(userShell string, args []strin | |||
| 	case "fish": | ||||
| 		cmd = fmt.Sprintf("eval (%s)", commandLine) | ||||
| 	case "powershell": | ||||
| 		cmd = fmt.Sprintf("%s | Invoke-Expression", commandLine) | ||||
| 		cmd = fmt.Sprintf("& %s | Invoke-Expression", commandLine) | ||||
| 	case "cmd": | ||||
| 		cmd = fmt.Sprintf("\tFOR /f \"tokens=*\" %%i IN ('%s') DO %%i", commandLine) | ||||
| 		comment = "REM" | ||||
|  |  | |||
|  | @ -56,13 +56,13 @@ func TestHints(t *testing.T) { | |||
| 		{"fish", []string{"./machine", "env", "--shell=fish", "--no-proxy", "--swarm", "default"}, "# Run this command to configure your shell: \n# eval (./machine env --shell=fish --no-proxy --swarm default)\n"}, | ||||
| 		{"fish", []string{"./machine", "env", "--shell=fish", "--unset"}, "# Run this command to configure your shell: \n# eval (./machine env --shell=fish --unset)\n"}, | ||||
| 
 | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "default"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--no-proxy", "default"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell --no-proxy default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--swarm", "default"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell --swarm default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--no-proxy", "--swarm", "default"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell --no-proxy --swarm default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--unset"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell --unset | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--unset"}, "# Run this command to configure your shell: \n# ./machine env --shell=powershell --unset | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{`C:\\Program Files\docker-machine.exe`, "env", "--shell=powershell", "default"}, "# Run this command to configure your shell: \n# \"C:\\\\Program Files\\docker-machine.exe\" env --shell=powershell default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "default"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--no-proxy", "default"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell --no-proxy default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--swarm", "default"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell --swarm default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--no-proxy", "--swarm", "default"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell --no-proxy --swarm default | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--unset"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell --unset | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{"./machine", "env", "--shell=powershell", "--unset"}, "# Run this command to configure your shell: \n# & ./machine env --shell=powershell --unset | Invoke-Expression\n"}, | ||||
| 		{"powershell", []string{`C:\\Program Files\docker-machine.exe`, "env", "--shell=powershell", "default"}, "# Run this command to configure your shell: \n# & \"C:\\\\Program Files\\docker-machine.exe\" env --shell=powershell default | Invoke-Expression\n"}, | ||||
| 
 | ||||
| 		{"cmd", []string{"./machine", "env", "--shell=cmd", "default"}, "REM Run this command to configure your shell: \nREM \tFOR /f \"tokens=*\" %i IN ('./machine env --shell=cmd default') DO %i\n"}, | ||||
| 		{"cmd", []string{"./machine", "env", "--shell=cmd", "--no-proxy", "default"}, "REM Run this command to configure your shell: \nREM \tFOR /f \"tokens=*\" %i IN ('./machine env --shell=cmd --no-proxy default') DO %i\n"}, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue