Thanks for getting in touch! Since you’re wanting to retrieve the custom installation directory in a separate step from the one that deploys the web application, you’d need to specify the step name in the variable using indexer notation. I suspect this will give you the directory value that your web app step sets: $dir = $OctopusParameters[‘Octopus.Action[WebAppStep].Package.CustomInstallationDirectory’]
Let me know how you go or if you have any further questions or concerns going forward!