Thanks for getting back to me @CTO - I can confirm that this doesn’t work as reported, but this looks like it’s a limitation of powershell in non-interactive sessions, than any bug with Octopus. I was able to get to this conclusion by the following tests:
Regular output in an interactive/active PowerShell session:
PS C:\Users\jwalsh> Get-Process | where-Object {$_.mainWindowTitle} | Measure-Object
Count : 4
Average :
Sum :
Maximum :
Minimum :
Property :
When calling powershell to run this command directly, it doesn’t allow access to the mainWindowTitle object element:
PS C:\Users\jwalsh> powershell.exe -Command Get-Process | where-Object {$_.mainWindowTitle} | Measure-Object
Count : 0
Average :
Sum :
Maximum :
Minimum :
Property :
So sadly, I’m afraid that you may need to investigate alternative means of finding your running process.
Please don’t hesitate to let me know if you have any further questions!