Get-Process -Name java -ErrorAction SilentlyContinue | ForEach-Object {
    $pid = $_.Id
    $proc = Get-CimInstance Win32_Process -Filter "ProcessId=$pid"
    Write-Output "PID: $pid CMD: $($proc.CommandLine)"
}
