Using referrence files in powershell scripts

Hi ,

I need help with some powershell execution on steps. Right now i have a feature activation ps1(activatefeature.ps1) script wich has reference to 2 files in the script.

  1. sitefactory.xml
  2. utilities.ps1

these files are normally stored in same directory as activatefeature.ps1. ive now moved activatefeature.ps1 to octopus and executing it. However, i need to make physical reference to those 2 files in order for it to run successfully.

How can i move those 2 files to octopus and make it work ? using Variables ? script modules ?

Ive attached the scripts for you referece.

Thank you.

uat_SiteFactory.xml (108 KB)

ActivateFeatures.txt (25 KB)

Utilities.txt (2 KB)

Hi Jayth,

Thanks for getting in touch! If you are making use of a NuGet package step before you run the activatefeature.ps1 you could include the files in that and reference them by using a variable from that step to where they were unpacked. Script modules are very useful, but they are also loaded for each step in a deployment, you cannot single them to a single step, so you would have to consider that if you want to go that route or you call this ps before your package step (or you don’t have a package step).

Hope that helps!
Vanessa