Skip to content

Instantly share code, notes, and snippets.

@lukecamilo
Created May 22, 2019 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukecamilo/a711bc1247650c84040e0b4df6b5a2b7 to your computer and use it in GitHub Desktop.
Save lukecamilo/a711bc1247650c84040e0b4df6b5a2b7 to your computer and use it in GitHub Desktop.
Muestra una barrita de progreso con parametros configurables
function show-progressbar([int]$actual,[int]$completo,[string]$status,[string]$Activity)
{
$porcentaje=($actual/$completo)*100
# Si no le pasamos un parametro $Status, pone uno generico
if (!$status){
$status="Buscando datos $actual de $completo"
}
# Si no le pasamos un parametro $Activity, pone uno generico
if (!$Activity){
$Activity="Obteniendo Resultados"
}
Write-Progress -Activity $Activity -status $status -percentComplete $porcentaje
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment