## p4get-clientopenfiles ## aaron bockelie <# .SYNOPSIS Returns all open files for a given clientspec .DESCRIPTION This function simply returns the a list of opened files for a given client in an object, for further processing. .EXAMPLE This example returns all open files for client 'voltron2' [PS] C:\Users\aaronadmin>p4get-clientopenfiles voltron2 client openedfiles ------ -------- voltron2 {@{depotFile=//depot/servi... The returned object contains the following objects: client: the name of the client operated against. files: an array of depot files that are opened for the given client. .PARAMETER clientname The client you wish to get a report on all files. .FUNCTIONALITY This function simplifies the overhead of listing files for a given client. #> Function p4get-clientopenfiles {param([Parameter(Mandatory = $true)]$clientname)#begin function p4remove-object $servercheck = p4get-server $errorprefs = $erroractionpreference #store original error action preference. $ErrorActionPreference = "Continue" if ($servercheck.pingsuccess.equals($true)) { $clientopenfiles = $null $client = $null $client = p4get-client $clientname if ($client -ne $null) { $clientopenfiles = p4get "opened -C" $client.client } } return new-object psobject -property @{"client" = $client.client;"openedfiles" = $clientopenfiles} $erroractionpreference = $errorprefs }