检查最新版本的Java JRE

在Linux或Windows上需要Powershell Core Powershell 3.0获取可从java.com获得的最新x64 rpm的文件名
.

0

linux命令:$file=(iwr -Uri ($(iwr "https://www.java.com/en/download/linux_manual.jsp").Links |? {$_.href -ilike "*javadl*" } |? {$_.innerText -ilike "*x64 rpm*"}).href -Method Head -Max 0 -ErrorAction 0).Headers.Location; (($file -Split "/")[-1] -split "&")[0] "&")[0] -split "/")[-1] -Split (($file 0).Headers.Location; -ErrorAction 0 -Max Head -Method rpm*"}).href "*x64 -ilike {$_.innerText |? } "*javadl*" -ilike {$_.href |? "https://www.java.com/en/download/linux_manual.jsp").Links ($(iwr -Uri $file=(iwr $file=(iwr -Uri ($(iwr "https://www.java.com/en/download/linux_manual.jsp").Links |? {$_.href -ilike "*javadl*" } |? {$_.innerText -ilike "*x64 rpm*"}).href -Method Head -Max 0 -ErrorAction 0).Headers.Location; (($file -Split "/")[-1] -split "&")[0]rootopen.com
linux命令:$file=(iwr -Uri ($(iwr "https://www.java.com/en/download/linux_manual.jsp").Links |? {$_.href -ilike "*javadl*" } |? {$_.innerText -ilike "*x64 rpm*"}).href -Method Head -Max 0 -ErrorAction 0).Headers.Location; (($file -Split "/")[-1] -split "&")[0] "&")[0] -split "/")[-1] -Split (($file 0).Headers.Location; -ErrorAction 0 -Max Head -Method rpm*"}).href "*x64 -ilike {$_.innerText |? } "*javadl*" -ilike {$_.href |? "https://www.java.com/en/download/linux_manual.jsp").Links ($(iwr -Uri $file=(iwr $file=(iwr -Uri ($(iwr "https://www.java.com/en/download/linux_manual.jsp").Links |? {$_.href -ilike "*javadl*" } |? {$_.innerText -ilike "*x64 rpm*"}).href -Method Head -Max 0 -ErrorAction 0).Headers.Location; (($file -Split "/")[-1] -split "&")[0]rootopen.com
yrnv 2018-03-19 01:40:48
输出

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令