Function p4get-triggers { $servercheck = p4get-server if ($servercheck.pingsuccess.equals($true)) { $protect = p4get "triggers -o" $protectindex = $protect | gm | ?{$_.membertype -eq "noteproperty"} | %{$_.name} foreach ($line in $protectindex) { $protect.$line } } }