win7试试这个ai给的方法- #@&cls&powershell "type '%~f0'|out-string|iex"&pause&exit
- $wc = New-Object System.Net.WebClient
- $wc.DownloadString('https://nr.ele.me/eleme_nr_bfe_retail/eb_download/config/download') -match 'http[^"]+'
- $sourceStream = $wc.OpenRead($matches[0])
- $targetStream = new-object System.IO.FileStream(("$pwd\"+($matches[0]-replace'.+/')), [System.IO.FileMode]::Create)
- $gzipStream = new-object System.IO.Compression.GZipStream($sourceStream, [System.IO.Compression.CompressionMode]::Decompress)
-
- $buffer = new-object byte[](1024)
- while($true)
- {
- $read = $gzipStream.Read($buffer, 0, 1024)
- if($read -le 0){ break }
- $targetStream.Write($buffer, 0, $read)
- }
-
- $gzipStream.Close()
- $targetStream.Close()
- $sourceStream.Close()
复制代码
|