## p4start-scriptinglog ## Aaron Bockelie function p4start-scriptinglog { #uniquify path has a bug when run on root of a drive. if (!$env:depotsxml) { write-error "Could not locate depots.xml configuration file." break } ## make this a switch case instead of fallthrough if ($MyInvocation.MyCommand.name -match "checkpoint") #if this is a checkpoint invocation { $static = ([xml](gc $env:depotsxml)).perforce.checkpointService $p4static = (([xml](gc $env:depotsxml)).perforce.depot | ?{$_.name -eq $depot}).checkpointPrefs } if ($MyInvocation.MyCommand.name -match "sync")#if this is a sync invocation { $static = ([xml](gc $env:depotsxml)).perforce.syncService $p4static = (([xml](gc $env:depotsxml)).perforce.depot | ?{$_.name -eq $depot}).syncPrefs } if ($MyInvocation.MyCommand.name -match "watchdog")#if this is a watchdog invocation { $static = ([xml](gc $env:depotsxml)).perforce.watchdogService $p4static = (([xml](gc $env:depotsxml)).perforce.depot | ?{$_.name -eq $depot}).watchdogPrefs } $global:transcript = (Uniquify-Path("{0}\{1}-{2:yyyy-MM-dd}.log" -f (get-location).path,$static.FilenamePrefix.tostring(),(get-date))) ("Starting transcript to " + $transcript.tostring()) Trap {Continue} Stop-Transcript > $null # in case anything already running via previous command in shell try { Start-Transcript $transcript -append > $null} catch { $transcript = $null } # ISE doesn't support transcripts, ok to ignore }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8423 | Aaron Bockelie |
Fixes and changes. Ported from a private depot, not listing specific changes at this point. |
||
#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. |