## p4get-userclient ## aaron bockelie <# .SYNOPSIS Returns all client objects in server, or group of client objects belonging to a specific user. .DESCRIPTION This function will return all clientspecs in an object or array of objects. Calling the function with no parameter will return all clientspecs in the server. Calling the function with a username will return all clients owned by that username, even if the user itself no longer exists on the server. .EXAMPLE Return all clients owned by a specific user. [PS] p4get-userclient aaron.bockelie Owner : aaron.bockelie Access : 1292030248 LineEnd : local SubmitOptions : submitunchanged Host : abockelie Root : c:\work\infosys Description : Created by aaron.bockelie. Options : noallwrite noclobber nocompress unlocked nomodtime normdir Update : 1291761503 client : abockelie Owner : aaron.bockelie Access : 1291767376 LineEnd : local SubmitOptions : submitunchanged ... ... .EXAMPLE Return all clients on the server. [PS] p4get-userclient aaron.bockelie Owner : aaron.bockelie Access : 1292030248 LineEnd : local SubmitOptions : submitunchanged Host : abockelie ... ... .PARAMETER username Optional parameter to return clients belonging to a specified user. #> Function p4get-userclient {param($username)#begin function p4remove-object $servercheck = p4get-server if ($servercheck.pingsuccess.equals($true)) { if ($username -eq $null) { write-progress -id 25 -activity "No user specified, returning ALL clientspecs." -status "You asked for it." p4get-client } else { write-progress -id 25 -activity ("Searching clientspec records matching user: " + $username) -status "Please be patient." $clients = @() $cmd = "p4get `"clients -u $username`"" $clientlist = iex $cmd | %{$_.client} p4get-client $clientlist } } write-progress -id 25 -completed -activity "Complete." -status "Complete." }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8410 | Aaron Bockelie |
Root checkin, Perforce Powershell wrapper. Still lots of work to be done, namely documentation and deployment tools, for instance, get-help needs work on the majority of these tools. Additionally, the /lib structure needs a little bit of condensation, probably into major groups (depot, userspec, clientspec, group management, and so on) that way function family can exist under each resource. |