Get Active Window Titles PowerShell Code
title: Contents
style: nestedList # TOC style (nestedList|inlineFirstLevel)
minLevel: 1 # Include headings from the specified level
maxLevel: 4 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console
Overview
Sources:
Code Snippet
- One-Liner:
# One-Liner:
Get-Process | Where-Object { $_.MainWindowTitle } | Format-Table Id, Name, MainWindowtitle -AutoSize
- Retrieve Only the Window Title:
(Get-Process -id 8748 -ErrorAction SilentlyContinue).MainWindowTitle
- Script:
<#
.SYNOPSIS
Gets a List of Active Application Window's ID, Name, and MainWindowTitle
#>
[CmdLetBinding()]
Param()
Begin {
$Processes = Get-Process | Where-Object { $_.MainWindowTitle }
}
Process {
$Processes | Format-Table Id, Name, MainWindowTitle -AutoSize
}
End {}
Details
See Also
Appendix
Note created on 2024-04-19 and last modified on 2024-04-19.
Backlinks
LIST FROM [[PowerShell - Get Active Window Titles]] AND -"CHANGELOG" AND -"04-RESOURCES/Code/PowerShell/PowerShell - Get Active Window Titles"
(c) No Clocks, LLC | 2024