Hi,
You can try something like this.
$notpressed = $true
$string = 'debug in progress:'
$dots = 100
$i = 0
while($notpressed){
$i++
if([console]::KeyAvailable)
{
$notpressed = $false
}
else{
if($i%($dots+1) -eq 1)
{
Write-Host $string -NoNewline
Start-Sleep -Milliseconds 500
}
elseif($i%($dots+1) -eq 0)
{
Write-Host '.'
Start-Sleep -Milliseconds 500
}
else{
Write-Host '.' -NoNewline
Start-Sleep -Milliseconds 500
}
}
}
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.