Created
January 15, 2025 13:28
-
-
Save MichalBrylka/dce96cb11564b44145825fc80b774592 to your computer and use it in GitHub Desktop.
Process.ps1
This file contains hidden or 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
$process = Get-Process | Where-Object { $_.MainWindowTitle -like "*xxx*" } | |
if ($process) { | |
# Get the executable file path | |
$exePath = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId = $($process.Id)" | Select-Object -ExpandProperty ExecutablePath | |
Write-Output "Executable Path: $exePath" | |
} else { | |
Write-Output "No process found with the specified window title." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment