mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-18 16:39:03 +02:00
Updated the manuals
This commit is contained in:
61
docs/new-tab.md
Normal file
61
docs/new-tab.md
Normal file
@@ -0,0 +1,61 @@
|
||||
The *new-tab.ps1* Script
|
||||
===========================
|
||||
|
||||
This PowerShell script creates and opens a new tab in Windows Terminal.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
/Repos/PowerShell/scripts/new-tab.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./new-tab.ps1
|
||||
✅ Created a new tab in Windows Terminal.
|
||||
|
||||
```
|
||||
|
||||
Notes
|
||||
-----
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
Related Links
|
||||
-------------
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.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
|
||||
}
|
||||
```
|
||||
|
||||
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:56)*
|
Reference in New Issue
Block a user