#Progress bar script of PowerShell to download Kubescape
$fullurl='https://github.com/kubescape/kubescape/releases/download/v2.0.168/kubescape-windows-latest'
$Total_size=((Invoke-WebRequest -Uri $fullurl -Method Head).Headers).'Content-Length'
$Downloaded_size=0
while($Downloaded_size -lt $Total_size){
$downloaded_percentage= ((100/$Total_size)*$Downloaded_size)+1
[MATH]::Floor($downloaded_percentage)
$Downloaded_size += ?
}
here is how to fetch real-time downloaded size during the downloading process without using any buffer operation.