$webClient = New-Object System.Net.WebClient
$Global:downloadComplete = $False
Register-ObjectEvent $webclient DownloadFileCompleted `
-SourceIdentifier WebClient.DownloadFileComplete `
-Action {$Global:downloadComplete = $true}
$source="http://XXXX\1.zip"
"Source Address is {0} " -f $source
$dest = "C:\windows.zip
$webClient.DownloadFile($source,$dest)
"the value of downloadComplete is {0}" -f $downloadComplete
why the DownloadComplete Event is not executed value of the download complete is still "Failse" ?
Best Regards, Mike