mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 17:38:19 +02:00
Added new-tab.ps1
This commit is contained in:
parent
28835cf13c
commit
7f08428442
24
scripts/new-tab.ps1
Normal file
24
scripts/new-tab.ps1
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Create a new tab in Windows Terminal
|
||||||
|
.DESCRIPTION
|
||||||
|
This PowerShell script creates and opens a new tab in Windows Terminal.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./new-tab.ps1
|
||||||
|
✅ Created a new tab in Windows Terminal.
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz | License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
& wt.exe --window 0 new-tab
|
||||||
|
if ($lastExitCode -ne 0) { throw "Executing wt.exe has failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
|
"✅ Created a new tab in Windows Terminal."
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user