- Get-NetIPAddress | Format-Table
- Get-NetIPAddress | select IPAddress | where { $_.IPAddress -match "192"}
- Get-NetIPAddress | select IPAddress | where { $_.IPAddress -match "169"}
- Get-NetIPAddress | select IPAddress | where { $_.IPAddress -match "127"}
- Get-NetIPAddress | select IPAddress, InterfaceAlias | where {$_.InterfaceAlias -match "Wireless"} # for Wireess network list
- Get-NetIPAddress | select IPAddress | where { $_.IPAddress }
- Get-NetIPAddress | select IPAddress , InterfaceAlias | Format-Table
- Get-NetIPAddress | select IPAddress , InterfaceAlias | where {$_.InterfaceAlias -match "VirtualBox" }
- Get-NetIPAddress | select IPAddress , InterfaceAlias , AddressState | sort { $_.AddressState }
- Get-NetIPAddress | select * | sort { $.AddressFamily, $.AddressState } | Format-Table
- Get-NetTCPConnection | select state , LocalAddress , LocalPort , RemoteAddress, RemotePort, OwningProcess | where {$_.State -match "Establish" } | Format-Table
Get Process with State like "Listen" คือมีการเปิดเซอร์วิส รอการเชื่อมต่อ , with port and process number
- Get-NetTCPConnection | select state , LocalAddress , LocalPort , RemoteAddress, RemotePort, OwningProcess | where {$_.State -match "Listen" } | Format-Table
- Get-Process | Select * | where {$_.ProcessName -match "httpd" }
-
$a_PID = $ (4,929) - Get-Process | Select id,ProcessName , CPU | where {$_.id -iin $a_PID }
- Get-Process | Select Name,Id,Product,Path,Company | where {$_.Name -match "chrome" } | Format-Table
- Get-Process | Select Name,Id,Product,Path,Company | where {$_.Path -match "xampp" } | Format-Table
- Get-Process | Select Name,Id,Product,Path | sort {$_.Product} | Format-Table
- Get-Process | Select Name,Id,Product,Company | sort {$_.Company} | Format-Table
- Get-Process | Select Name,Id,Company ,Path| sort {$_.Company} | Format-Table
- Get-Partition # Get Disk Partition
- Get-PSDrive # Get Disk / Certificate / Environment / Registry / Variable
- Get-EventLog Application -Newest 20
- Get-EventLog System -Newest 20
- Get-WmiObject win32_service -Filter "name like '%Apac%' or name like '%HTTP%' " | Format-Table ( This display ExitCode/Name/ProcessId/StartMode/State/Status )
PS C:> Get-Service "Apache2.2" -RequiredServices
Status Name DisplayName
------ ---- -----------
Running Afd Ancillary Function Driver for Winsock
Running Tcpip TCP/IP Protocol Driver