Function p4get-change {param([Parameter(Mandatory=$true)][int]$changelist) $multiPartChange = (p4get "change -o $changelist") if ($multiPartChange.count -gt 1) #if the array is split, we need to rejoin. { $change = new-object psobject #instantiate this line for the file info foreach ($part in $multiPartChange) { $methods = $part | gm | ?{$_.MemberType -eq "NoteProperty"} foreach ($method in $methods) { add-member -inputobject $change -membertype $method.MemberType -name $method.name -value $part.($method.name) } } } else { $change = $multiPartChange } #hack to get the description text regardless $ztagChange = p4 -ztag change -o $changelist #get the full change text in ztag format $ztagChange = $ztagChange -join "`n" #make it one long string $description = $ztagChange.remove(0,$ztagChange.IndexOf("... Description ")+16) #hack off all the crap before description tag the +16 is to increment the index of the text out of there. if (($description.IndexOf("`n... ") -ge 0)) { $description = $description.remove($description.IndexOf("`n... "),$description.length-$description.IndexOf("`n... ")) #hack off the rest of the crap after the next p4 tag (...) } $change.description = $description #slide that shit right in there. Nobody's looking, I checked. $change #print out the change. }
# | 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. |