mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 17:30:37 -06:00
added use of wt if available in winutil standalone script
Credits: #2565
This commit is contained in:
parent
77c5a158f5
commit
de3657adfa
@ -39,7 +39,15 @@ param (
|
|||||||
"-NoProfile", # Don't load PowerShell profile
|
"-NoProfile", # Don't load PowerShell profile
|
||||||
"-File", $MyInvocation.MyCommand.Source, # Script path
|
"-File", $MyInvocation.MyCommand.Source, # Script path
|
||||||
$args | ForEach-Object { $_ } # Script arguments
|
$args | ForEach-Object { $_ } # Script arguments
|
||||||
) | ForEach-Object { "`"$_`"" }
|
)
|
||||||
|
|
||||||
|
if ($Debug) {
|
||||||
|
$PwshArgList = @(
|
||||||
|
"-NoExit" # Don't exit after running the command
|
||||||
|
) + $PwshArgList
|
||||||
|
}
|
||||||
|
|
||||||
|
$PwshArgList = $PwshArgList | ForEach-Object { "`"$_`"" }
|
||||||
|
|
||||||
$WorkingDirectory = Get-Location
|
$WorkingDirectory = Get-Location
|
||||||
|
|
||||||
@ -51,6 +59,17 @@ param (
|
|||||||
PassThru = $true;
|
PassThru = $true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use 'wt' if available
|
||||||
|
if (Get-Command "wt" -ErrorAction SilentlyContinue) {
|
||||||
|
$WtArgList = @(
|
||||||
|
"new-tab",
|
||||||
|
$ProcessParameters.FilePath
|
||||||
|
) + $PwshArgList
|
||||||
|
|
||||||
|
$ProcessParameters.FilePath = "wt.exe"
|
||||||
|
$ProcessParameters.ArgumentList = $WtArgList
|
||||||
|
}
|
||||||
|
|
||||||
$process = $null
|
$process = $null
|
||||||
try {
|
try {
|
||||||
$process = Start-Process @ProcessParameters
|
$process = Start-Process @ProcessParameters
|
||||||
|
Loading…
Reference in New Issue
Block a user