- Home
- Explore Truckee
- Events
- News
- Play Outdoors
- Living Here
- Truckee Chamber
- Contact
- Business Directory
- Truckee Jobs Collective
- Member Login
# Set your Spotify credentials $clientId = "your_client_id" $clientSecret = "your_client_secret"
If you have multiple playback devices connected to your PC, you might want to switch between them programmatically. This script uses the Spotify Web API and PowerShell to switch between playback devices.
# Add tracks to the playlist $tracks = Get-SpotifyTrack -Query "genre:pop" -ClientId $clientId -ClientSecret $clientSecret foreach ($track in $tracks) { Add-SpotifyTrackToPlaylist -PlaylistId $playlist.Id -TrackId $track.Id -ClientId $clientId -ClientSecret $clientSecret } This script creates a new playlist called "My Custom Playlist" and adds tracks to it based on a query (in this case, genre:pop).