Added modules from WinAPI
This commit is contained in:
parent
56da334ea2
commit
b709d7e96b
24 changed files with 657 additions and 125 deletions
|
|
@ -2,17 +2,23 @@ function Find-Process {
|
|||
param (
|
||||
$ProcessName
|
||||
)
|
||||
$ProcessPath = (Get-ChildItem "C:\Program Files" | Where-Object Name -match $ProcessName).FullName
|
||||
if ($null -eq $ProcessPath) {
|
||||
$ProcessPath = (Get-ChildItem "C:\Program Files (x86)" | Where-Object Name -match $ProcessName).FullName
|
||||
$PathSearchArray = @(
|
||||
"$env:SystemDrive\Program Files",
|
||||
"$env:SystemDrive\Program Files (x86)",
|
||||
"$env:HOMEPATH\AppData\Roaming",
|
||||
"$env:HOMEPATH\Documents"
|
||||
)
|
||||
foreach ($PathSearch in $PathSearchArray) {
|
||||
$ProcessPath = (Get-ChildItem $PathSearch | Where-Object Name -match $ProcessName).FullName
|
||||
if ($null -ne $ProcessPath) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($null -eq $ProcessPath) {
|
||||
$ProcessPath = (Get-ChildItem "C:\Users\lifailon\AppData\Roaming" | Where-Object Name -match $ProcessName).FullName
|
||||
}
|
||||
$ProcessNameExec = "$ProcessName"+".exe"
|
||||
$ProcessNameExec = "$($ProcessName).exe"
|
||||
(Get-ChildItem $ProcessPath -Recurse | Where-Object Name -eq $ProcessNameExec).FullName
|
||||
}
|
||||
|
||||
# Find-Process OpenHardwareMonitor # C:\Users\lifailon\Documents\OpenHardwareMonitor-0.9.6\OpenHardwareMonitor-0.9.6\OpenHardwareMonitor.exe
|
||||
# Find-Process qbittorrent # C:\Program Files\qBittorrent\qbittorrent.exe
|
||||
# Find-Process nmap # C:\Program Files (x86)\Nmap\nmap.exe
|
||||
# Find-Process telegram # C:\Users\lifailon\AppData\Roaming\Telegram Desktop\Telegram.exe
|
||||
Loading…
Add table
Add a link
Reference in a new issue