Is it possible to run powershell instead of basic command prompt commands (Runtime.getRuntime().exec()?

I need to install an SSL certificate on my machine as part of my initial setup for web testing with Katalon. I’m trying to automate this process, and the only way so far that works without getting a Windows security popup which requires you to manually click Yes/No to is by using an actual Powershell window (launched as as Administrator). I’m trying to avoid the popup as controlling Windows with Katalon might be a big bag of worms that I am not familiar with.

I have been using command prompt calls with Runtime.getRuntime().exec(), and I have been using powershell -command with that, but installing a cert without a popup seems to require actual powershell with admin privileges.

Is there a way to use Powershell as admin commands from Katalon? This is what I am trying to avoid:
image

This is what I am running but requires me to click Yes/No on that popup:

powershell -command "Import-Certificate -FilePath C:/Users/Admin/Downloads/Logiscend.cer -CertStoreLocation Cert:/CurrentUser/Root"

println('Command being run to import the cert will be:' + cmd)

Runtime.getRuntime().exec(cmd)
1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Looking forward to all the experts with experiences in this to support @matthew.burke1.

When I worked with U2, there was constant interactions with Windows via DOS commands (the application was something like 30 years old). There were a LOT of “flags”, or options, that can be appended to those commands, to ensure how the environment was controlled without “you” being actually in front of the keyboard. So, how about investigating the various “flags” that are available for Powershell, like adding “-Confirm$false” to the end of your powershell command.