Last active
November 4, 2017 16:18
-
-
Save SchoolforDesign/fa2cf2539f69a6cb51a86f8b3950e8d2 to your computer and use it in GitHub Desktop.
kaka muhamed
This file contains 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
$GetCon = Get-NetTCPConnection | |
$gpsc = Get-Process | |
$GName = foreach ($process in $GetCon) { | |
$processName = ($gpsc | ? id -EQ $process.OwningProcess).ProcessName | |
$processName | ForEach-Object{ | |
if($processName.Length -ne 0){ | |
$processName | |
}else{ | |
$processName = "ProcessName Nya" | |
} | |
} | |
$process | Add-Member -NotePropertyName ProcessName -NotePropertyValue $processName -PassThru | |
} | |
$GetCon | select ProcessName, OwningProcess | Where-Object {$_.ProcessName -eq "chrome"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment