Created
August 31, 2020 11:49
-
-
Save dfbaskin/033f8c81582fd310a428e302a60dca7c to your computer and use it in GitHub Desktop.
Use Powershell Core and Microsoft Terminal to open node and dotnet application side-by-side.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$shellName = 'pwsh' | |
) | |
$commands = @( | |
[PSCustomObject]@{ | |
Path = 'my-node-project' | |
Command = 'npm.cmd start' | |
Window = 'new-tab' | |
} | |
[PSCustomObject]@{ | |
Path = 'my-dotnet-project' | |
Command = 'dotnet.exe watch run' | |
Window = 'split-pane' | |
} | |
) | |
$argList = $commands | | |
ForEach-Object { | |
$cmd = $_ | |
$fullPath = Join-Path $PSScriptRoot $cmd.Path -Resolve | |
@( | |
$cmd.Window | |
"-p $shellName" | |
"-d $fullPath" | |
"pwsh -noexit -command $($cmd.Command)" | |
) -join " " | |
} | | |
Join-String -Separator " ; " | |
Start-Process -FilePath "wt.exe" -ArgumentList $argList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment