List Net Apps
Lets say that you want a list of network apps running in windows at a given time. I have written a simple script in Powershell to handle this:
function global:get-netappsjust run: get-netapps or lsnetapps
{
$myfile = (& netstat -abno )
$mymatches = $myfile -match "\[(?.*\.exe)\]`$"
$results = ""
foreach ($line in $mymatches)
{
if ($results.Contains($line.Replace('[','').Replace(']','')) -eq 0)
{
$results += $line.Replace('[','').Replace(']','') + "`n"
}
}
$results
}
Set-Alias lsnetapps get-netapps -Scope "global"
Labels: Powershell, Script, tips