################################################################################ #setJacaCerts.ps1 -certfile \\mydom\netlogon\certs\mycert.crt -alias mytomcat #installiere ein Zertifikat in den Javastore des Benutzers / rb /2019 ################################################################################ param( [string]$certfile, [string]$alias ) $keystore = $env:USERPROFILE + "\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs" $javahome = gci HKLM:\Software\JavaSoft -rec -ea SilentlyContinue | ` % { if((get-itemproperty -Path $_.PsPath) -match "JavaHome") { $_.PsPath} } | ` Get-ItemProperty| select-Object -last 1 | ft -HideTableHeader JavaHome | out-String $keytoolpath = $javahome.Trim()+"\bin\keytool.exe" Start-Process -FilePath "$keytoolpath" -ArgumentList '-importcert',"-alias $alias","-file $certfile",` '-storepass mypassw0rd','-noprompt',"-keystore $keystore" -NoNewWindow ################################################################################