运维请看 - 20号Java SE 8 刚更新,分享个安装JDK的powershell脚本
https://www.java.com/releases/基本上就是装 8u301,删所有旧版本,请小心使用
# PowerShell script to automatically download and install the latest Java SE (JDK) version 8u301
::SecurityProtocol = ::Tls12
# Download and install Offline Java installer
$uri = "https://javadl.oracle.com/webapps/download/AutoDL?BundleId=245045_d3c52aa6bfa54d3ca74e617f18309292"
$path = "$PSScriptRoot\jdk8_x64.exe"
(New-Object System.Net.WebClient).DownloadFile($uri, $path)
Start-Process $PSScriptRoot\jdk8_x64.exe '/s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0' -wait
echo $?
$RegUninstallPaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
)
# Stop running Java process
Get-CimInstance -ClassName 'Win32_Process' | Where-Object {$_.ExecutablePath -like '*Program Files\Java*'} | Select-Object @{n='Name';e={$_.Name.Split('.')}} | Stop-Process -Force
$VersionsToKeep = '8 Update 301'
$UninstallSearchFilter = {($_.GetValue('DisplayName') -like 'Java*') -and ($_.GetValue('Publisher') -like 'Oracle*') -and ($_.GetValue('DisplayName') -notlike "*$VersionsToKeep*")}
# Uninstall all older Java versions (incl. Auto Updater)
foreach ($Path in $RegUninstallPaths) {
if (Test-Path $Path) {
Get-ChildItem $Path | Where-Object $UninstallSearchFilter | foreach {
Write-Host Uninstalling $_.GetValue('DisplayName') ...
Start-Process 'C:\Windows\System32\msiexec.exe' "/X$($_.PSChildName) /qn /norestart" -Wait
}
}
}
大佬求一下go+python 双语言混合开发的sql文件
页:
[1]