Untitled
unknown
plain_text
10 months ago
520 B
4
Indexable
$FileDownloaded = $false
while (-not $FileDownloaded) {
if (Test-Path $DestinationPath) {
# Get the initial file size
$InitialSize = (Get-Item $DestinationPath).Length
Start-Sleep -Seconds 2
# Get the size again after a short delay
$NewSize = (Get-Item $DestinationPath).Length
if ($InitialSize -eq $NewSize) {
# File size is stable, download likely complete
$FileDownloaded = $true
}
} else {
Start-Sleep -Seconds 1
}
}Editor is loading...
Leave a Comment