Some problems with Handle

Hi, i have some problems then try to kill handles to some windows service directory.
i use hfndle from https://octopusdeploy.com/blog/how-to-handle-locked-files on windows 2012p2, and see next problem:
then shell script started by octopus call handle on any foldier, handle see handles only from user who starts octopus tentacle service.
Some search give me solution https://social.technet.microsoft.com/Forums/windowsserver/en-US/6c7d602d-7248-4718-ae76-a14ea5ec87fa/problems-with-handleexe-in-powershell?forum=winserverpowershell and its work perfect, but for this solution i mast write something like this: & C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -nologo -file c:\test.ps1 in pre deploy scripts, and i must have script files and etc…
Maybe i don’t know more simple solution of this problem?

Hi Kirill,

Thanks for reaching out. I cant think of another way to do so . Your approach does seem to work and its not very complicated. I’d personally go with it.

Regards,

Dalmiro

Hi Dalmiro,

Can i change start path to power shell for octopus tentacle?
This one: C:\Windows\system32\Windowspowershell\v1.0 to this C:\Windows\syswow64\Windowspowershell\v1.0 ?

Hi,

Not from Octopus, but you could change the start path for the user running the Tentacle Service. Personally, i wouldnt recommend this as it might have side effects on other commands in the future. I’d recommend you to just go with the long line script you mentioned on your first post, as you’ll most likely need to use the syswow64 version just this time.

Thanks

Dalmiro