Function p4add-depotspec {param([Parameter(Mandatory=$true)]$Depot,$Owner,$Date,$Description,$Type,$Address,$Suffix,$Map) $datefield = (get-date).year.tostring() + "`/" + (get-date).month.tostring() + "`/" + (get-date).day.tostring() + " " + (get-date).hour.tostring() + ":" + (get-date).Minute.tostring() + ":" + (get-date).second.tostring() #format date string to exactly what perforce wants #([datetime]"1/1/1970").AddSeconds($Update) if ($Owner -eq $null) { $Owner = $env:username #default username to current user if none defined. } if ($Date -eq $null) { $Date = $datefield #add default date if none defined } if ($Description -eq $null) { $Description = "DepotSpec created by p4add-depotspec on " + $datefield + " by user " + $env:username #set a useful description, if description not defined. } if ($type -eq $null) { $type = "local" #add default options if none were defined. } if ($Address -eq $null) { $Address = "local" #add default date if none defined } if ($suffix -eq $null) { $suffix = ".p4s" } if ($map -eq $null) { $map = ($depot + "/...") } $spec = "`r`nDepot:`t" + $Depot + "`r`n`r`nOwner:`t" + $Owner + "`r`n`r`nDate:`t" + $Date + "`r`n`r`nDescription:`r`n`t" + $Description + "`r`n`r`nType:`t" + $Type + "`r`n`r`nAddress:`t" + $Address + "`r`n`r`nSuffix:`t" + $Suffix + "`r`n`r`nMap:`r`n`t" + $map #create a group issue command in a format that perforce can digest. return $spec }#end function p4add-depotspec