You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docker-for-windows/index.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,6 +284,44 @@ The next few steps take you through some examples. These are just suggestions fo
284
284
285
285
**Want more example applications?** - For more example walkthroughs that include setting up services and databases with Docker Compose, see [Example Applications](examples.md).
286
286
287
+
## Set up tab completion in PowerShell
288
+
289
+
If you would like to have handy tab completion for Docker commands, you can install the <ahref="https://github.com/samneirinck/posh-docker">posh-docker</a> PowerShell Module as follows.
290
+
291
+
1. Start an "elevated" PowerShell (i.e., run it as administrator).
292
+
293
+
To do this, search for PowerShell, right-click, and choose **Run as administrator**.<br>
294
+
295
+

296
+
<br><br>
297
+
When asked if you want to allow this app to make changes to your device, click **Yes**.
298
+
299
+
2. Set the [script execution policy](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.security/set-executionpolicy) to allow downloaded scripts signed by trusted publishers to run on your computer. To do so, type this at the PowerShell prompt.
300
+
<br>
301
+
`Set-ExecutionPolicy RemoteSigned`
302
+
<br>
303
+
To check that the policy is set properly, run `get-executionpolicy`, which should return `RemoteSigned`.
304
+
<br>
305
+
3. To enable auto-completion of commands for the current PowerShell only, type:
306
+
307
+
`Import-Module posh-docker`
308
+
309
+
4. To make tab completion persistent across all PowerShell sessions, add the command to a `$PROFILE` by typing these commands at the PowerShell prompt.
This creates a `$PROFILE` if one does not already exist, and adds this line into the file:
315
+
316
+
`Import-Module posh-docker`
317
+
318
+
<br>
319
+
To check that the file was properly created, or simply edit it manually, type this in PowerShell:
320
+
321
+
`Notepad $PROFILE`
322
+
323
+
Now, when you press tab after typing the first few letters, Docker commands such as `start`, `stop`, `run`, and their options, along with container and image names should now auto-complete.
324
+
287
325
## Docker Settings
288
326
289
327
When Docker is running, the Docker whale is displayed in the system tray. If it is hidden, click the up arrow in the tray to show it.
0 commit comments