diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 1ca51beb..739ab371 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -52,6 +52,22 @@ Below is the full list of supported commands and options for the `wt` command li Commands may vary slightly depending on which command line you're using. +### Passing an argument to the default shell + +To start an instance of Windows Terminal and have it execute a command, call `wt.exe` followed by your command. + +Here's an example of calling Windows Terminal to pass a [ping](https://docs.microsoft.com/windows-server/administration/windows-commands/ping) command argument to echo an IP address: + +```powershell +wt ping docs.microsoft.com +``` + +Here's an example of calling Windows Terminal to open a new tab with a PowerShell command line, confirming to call the [Start-Service](https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service) command, and opening another new tab with Windows Command Prompt open to the `/k` directory: + +```cmd +wt new-tab PowerShell -c Start-Service ; new-tab cmd /k dir +``` + ### Target a specific window > [!IMPORTANT]