Public/Get-ShellPhishMyShowHistory.ps1
|
function Get-ShellPhishMyShowHistory { <# .SYNOPSIS Shows every concert a user has attended, enriched with venue details. .PARAMETER Username Phish.net username to look up attendance for. .PARAMETER ExportPath Optional file path (.csv or .json) to export results. .PARAMETER DelayMs Delay in milliseconds between API calls. Default 500. .EXAMPLE PS C:\> Get-ShellPhishMyShowHistory -Username wilson .EXAMPLE PS C:\> Get-ShellPhishMyShowHistory -Username wilson -ExportPath ./my-shows.csv #> [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [string]$Username, [Parameter()] [string]$ExportPath, [Parameter()] [int]$DelayMs = 500 ) Write-Verbose "Fetching attendance for $Username..." $attendance = (Get-ShellPhishAttendance -Username $Username).data if (-not $attendance) { Write-Warning "No attendance records found for $Username" return } Write-Verbose "Found $($attendance.Count) show(s). Enriching with show details..." $results = foreach ($record in $attendance) { Start-Sleep -Milliseconds $DelayMs $show = (Get-ShellPhishShows -ShowId $record.showid).data [PSCustomObject]@{ Date = $record.showdate Venue = $show.venue City = $show.city State = $show.state Country = $show.country ShowId = $record.showid Artist = $show.artist_name } } $sorted = $results | Sort-Object Date Export-ShellPhishData -Data $sorted -ExportPath $ExportPath } |