? Did you ever create a Parameter named PowerShellexe ? If not, that substition will fail. Also, you shouldn’t need to set it as a variable anyway, powershell.exe should be in the path.
Also, don’t use "{__Download}\Removeold_java_versions.ps1"
. In that substitution, the client will expect {__Download}
to be a relevance expression; which it’s not. If you wanted to write an expression that returned the __Download
string, that would just be {“__Download”}, but in that case you don’t need a substitution at all.
…again, did you ever define a parameter “PowerShellExe”?[quote=“TheCookieMonster, post:1, topic:23566”]
Failed waithidden powershell -executionpolicy bypass -File {_Download\Removeold_java_versions.ps1}
[/quote]
…closer, but {_Download\Removeold_java_versions.ps1}
is not a valid substitution because __Download… is not a Relevance expression.
powershell.exe is not in the __Download
folder, it should be hanging out at \windows\system32 (and in the system PATH so you don’t need to specify the full path to it anyway)
I’m not sure whether powershell will start in the current working directory, but in any case the downloaded .ps1 script is not in the current directory (__BESData\SiteName
), it’ll be under the download folder (__BESData\SiteName\__Download
)
So, what I think you should try, is to run the powershell.exe that’s in the system PATH, but use Relevance to get the fully-qualified path to the downloaded .ps1 file. Also, you may need to disable wow64 redirection, so that you’re executing the 64-bit version of powershell and not the 32-bit version (which will make a big difference if you’re trying to remove a 64-bit JRE).
Give this a try -
[download the script]
action uses wow64 redirection false
wait powershell.exe -executionpolicy bypass -File “{pathname of download file “Removeold_java_versions.ps1”}”
Also, I’ll edit your post to put the code tags around your commands. Lines that have "__"
in them get interpreted by the forum software as formatting tags so they don’t appear correctly unless you use the code tag on them