Choice parameter depending on files

Hi there,
i want to use a choice parameter. The options of the pipeline parameter should depend on files on the agent system: The options should be the filenames in a specific folder.

Is there a possibility to run a powershell script before the stages are called? I don’t want to use the extensible choise plugin.