src/Public/Delete-OwnDebugLogs.ps1
function Delete-OwnDebugLogs { [CmdletBinding()] Param( [Parameter(Mandatory = $false)][Alias("o")]$orgAlias ) $tmp = New-TemporaryFile sf org display user -o $orgAlias --json | ConvertFrom-Json | Tee-Object -variable userOrgResult sf data query --query "SELECT Id FROM ApexLog WHERE LogUserId = '$($userOrgResult.result.Id)'" -o $orgAlias -r csv | ConvertFrom-Csv | Export-Csv -NoTypeInformation -Path $tmp.FullName sf data delete bulk -o $orgAlias --sobject ApexLog --file $tmp.FullName --wait 100 } |