标签:load sub for shell inpu pow path input tps
powershell 2.0 , win 7 以上操作系统可用。
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") $path = "D:\front\" $library = "element-ui" $json = "[]" $json = $client.DownloadString("https://api.bootcdn.cn/libraries/"+ $library +".json") $ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer $obj = $ser.DeserializeObject($json) ##$info = ConvertFrom-Json -InputObject $json if($obj.assets.length){ $array = $obj.assets[0].files $version = $obj.assets[0].version $client = new-object System.Net.WebClient foreach ($src in $array){ $url = "https://cdn.bootcss.com/"+ $library +"/" + $version +"/" + $src $des = ( $path + $library + "@" + $version +"/" + $src ).replace("/", "\") if((Test-Path $des.Substring(0,$des.LastIndexOf(‘\‘)) ) -eq $False) { New-Item $des.Substring(0,$des.LastIndexOf(‘\‘)) -type directory } $client.DownloadFile($url,$des) } }
标签:load sub for shell inpu pow path input tps
原文地址:https://www.cnblogs.com/edit/p/9541206.html