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