I'm using PowerShell to automate my build and upload process. As part of it, I'm using Invoke-RestMethod to upload my file to my API endpoint. This is my command to upload:
Invoke-RestMethod -Uri $uploadEndpoint -Method Post -ContentType "multipart/form-data; boundary=`"$boundary`"" -Body $bodyLines -Headers $headers | Out-Null
Before invoking this command I'm using Write-Host a line without breaking to a new line, and when it's done I'm using Write-Host with a line break with "OK", so the output is something like this:
Uploading version to server... [OK]
What I'm wondering is if there is a way to get the progress of the file upload from the Invoke-RestMethod and while uploading show the progress percentage of the call. Something like:
Uploading version to server... 43%
Write-Progressis made for this type of behaviour, I am not awareInvoke-RestMethodprovides information with which one could calculate the progress. - Alex_P