When Octopus executes a script on a tentacle, it sends the script (as text) to the tentacle and then invokes PowerShell to run the script. So the behaviour you are describing is quite puzzling.
One way you could see behaviour like this is if the directory is passed to the script as a variable. All variables come to the tentacle as a text file and those variables are setup before Octopus starts your script.
One useful debugging technique is to run the script independent of Octopus on the target machine (using the account that the tentacle would use to run the script) and see what the result is.