pushd ~\Downloads $file = (pwd).ToString() + "\ABIS_Foundation_SDK_8.4.ECO.zip" $path = "C:\ProgramData\L1ID"; $msg = "["+ (Get-Date -Format "yyyy-MM-dd HH:mm:ss") + "]`t" if(!(Test-Path $path)) { mkdir $path } Write-Host $msg "Begin Download" $uri = New-Object "System.Uri" "https://vc6oneclick.biometrica.com/Downloads/ABIS_Foundation_SDK_8.4.ECO.zip" $request = [System.Net.HttpWebRequest]::Create($uri) $request.set_Timeout(15000) #15 second timeout $response = $request.GetResponse() $totalLength = [System.Math]::Floor($response.get_ContentLength()/1024) $responseStream = $response.GetResponseStream() $targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $file, Create $buffer = new-object byte[] 10KB $count = $responseStream.Read($buffer,0,$buffer.length) $downloadedBytes = $count while ($count -gt 0) { Write-Progress -Activity "Downloading Module" -Status "Writing $file" -PercentComplete ([Math]::Min([Math]::Floor($downloadedBytes/1024/$totalLength*100),100)) $targetStream.Write($buffer, 0, $count) $count = $responseStream.Read($buffer,0,$buffer.length) $downloadedBytes = $downloadedBytes + $count } Write-Progress -Activity "Downloading Module" -Status "Writing $file" -Completed $targetStream.Flush() $targetStream.Close() $targetStream.Dispose() $responseStream.Dispose() Write-Host $msg "Download Complete" Write-Host $msg "Begin Installation" $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($path).copyhere($item) } Write-Host $msg "Installation Complete" Write-Host "Remember you must now run Visual Casino as an Administrator to register the newly installed module"