1

I have a function am working on, I have placed an xml file in the same folder as the function. I'm trying to get this folder using syntax like this: ./file.xml or ~/functionfolder/file.xml .. but nothing is working. I saw other posts online suggesting using something like this:

$EXECUTION_CONTEXT_FUNCTIONDIRECTORY .. however when I write-host $EXECUTION_CONTEXT_FUNCTIONDIRECTORY it shows nothing.

Any help is appreciated.

M365 Dev
  • 43
  • 5

1 Answers1

0

On Functions V3 and V2, $PSScriptRoot contains the path of the directory where the running script is located. You can refer to other files like this: $PSScriptRoot\file.xml. $EXECUTION_CONTEXT_FUNCTIONDIRECTORY was available in the experimental and not officially supported V1 implementation.

Anatoli Beliaev
  • 1,614
  • 11
  • 13