Powershell context question

I like to develop / debug my Octopus powershell scripts in ISE but in doing so I have to fake up variables that are normally defined in octopus. I then have to comment these variables in / out depending if running in ocotopus or debugging in ISE. Is there a good way in powershell to determine if my script is running under Octopus or ISE? If so I could conditionally fake up variables and not have to comment them in/out.


var $isOctopus = Test-Path variable:global:OctopusParameters

…should do it; you may need to tweak it, I haven’t tested this locally.