Generate script for all stored procedures in Azure SQL database
The solution can be found below:

https://www.geekshangout.com/powershell-an-example-of-how-to-save-a-queries-results-to-a-csv-file/
https://www.reddit.com/r/PowerShell/comments/530jhx/csv_file_to_txt_file/

First save as .csv and later convert to .txt or .sql