mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-16 04:42:55 +08:00
Add files via upload
This commit is contained in:
parent
83c34e497c
commit
2c29e7d985
24
powershell/test-progressbar-ls.ps1
Normal file
24
powershell/test-progressbar-ls.ps1
Normal file
@ -0,0 +1,24 @@
|
||||
<# REF: https://techgenix.com/adding-a-progress-bar-to-your-powershell-scripts/ #>
|
||||
|
||||
cd /Volumes/zhgstera6/shrcompr-zhgst6
|
||||
|
||||
$List = Get-Childitem
|
||||
|
||||
$TotalItems=$List.Count
|
||||
$CurrentItem = 0
|
||||
$PercentComplete = 0
|
||||
|
||||
ForEach($file in $List)
|
||||
{
|
||||
Write-Progress -Activity "LS Filenames" `
|
||||
-Status "$PercentComplete% Complete: $CurrentItem / $TotalItems" `
|
||||
-PercentComplete $PercentComplete
|
||||
|
||||
# do a thing here
|
||||
#$Name = $VM.Name
|
||||
#Get-VM -Name $Name
|
||||
|
||||
$CurrentItem++
|
||||
$PercentComplete = [int](($CurrentItem / $TotalItems) * 100)
|
||||
Start-Sleep -Milliseconds 10
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user