$token = "YOUR_BITLY_TOKEN" $inputFile = "C:\Users\YourName\Desktop\links.txt" $outputFile = "C:\Users\YourName\Desktop\shortened_links.txt" Get-Content $inputFile | ForEach-Object $longUrl = $_ $body = @ long_url = $longUrl

https://example.com/very-long-article-about-tech https://another-site.com/page?id=12345 Save the file with UTF-8 encoding. Open PowerShell and run the following script (replace YOUR_BITLY_TOKEN and the file path):

This reads each URL from your .txt , shortens it via Bitly’s API, and saves the short links into a new file. Open shortened_links.txt – you’ll see one Bitly link per line, matching the order of your original URLs. Alternative: Using cURL on Windows 10 If you prefer Command Prompt with cURL: