Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBookV2
Script Library
Twitter Grid
Modules
QuickClick
Scripts
Snippets
Videos
Library
»
Script Library
»
Windows 7
»
Slideshow
Windows 7 Slideshow
Share
|
Browse Library
Module Library
QuickClick Library
Script Library
Active Directory
BizTalk
Citrix
Clustering
Desktop
Exchange Server 2003
Exchange Server 2007
File System
Group Policy
Internet Information Server (IIS)
Local Accounts
Logs
Microsoft Office
Microsoft Team Foundation Server
MySQL
Networking
Registry
Remote Desktop Services
Remoting
Security
SharePoint
SQL Server
System Center Virtual Machine Manager
System Center Configuration Manager
System Center Operations Manager
Tutorial
Terminal Server
Using .Net
Virtual Server
VMware
Windows 7
Windows HPC
Windows Server 2000
Windows Server 2003
Windows Server 2008
Windows XP
WMI
Misc
Snippet Library
Video Library
Members Only
Tags
Add-Member
aman dhally
API
Audio
brightness
Confirm
DateTime
Explorer
font
full text search
Get-EventLog
Get-Shortcut
Height
HTML
Internet
JavaScript
Link
not responding
office
PowerShell
Property
Service
Shortcut
Windows7
WScript.Shell
View more
Find-ChildProcess
# sample provided by PowerShell MVP Dr. Tobias Weltner
# for great inhouse PowerShell trainings, contact me at tobias.weltner@email.de
function
Find-ChildProcess
{
param
(
$ID
=
$PID
)
$CustomColumnID
=
@{
Name
=
'Id'
Expression
=
{ [
Int
[]]
$_
.
ProcessID
}
}
$result
=
Get-WmiObject
-Class
Win32_Process
-
Filter
"ParentProcessID=$ID"
|
Select-Object
-Property
ProcessName,
$CustomColumnID
, CommandLine
$result
$result
|
Where-Object
{
$_
.
ID
-ne
$null
} |
ForEach-Object
{
Find-ChildProcess
-id
$_
.
Id
}
}
# launch processes from within your powershell
# then try
# Find-ChildProcess
# Find-ChildProcess | Stop-Process -whatif
Loading...
Find-ChildProcess
Remove-Font
Pin Office...
Desktop Managemnt...
Disk Cleanup...
Set ComputerName...
Kill "Not...
System Information...
Change Windows...
Search for...
View all files
Copyright 2011 PowerShell.com. All rights reserved.