I wrote a Powershell script, and I call some functions from external scripts using Dot sourcing. The scripts I try to call are not detected after making the main script executable. Do I have to compile the scripts to be called as well?
Asked
Active
Viewed 166 times
0
-
**Include** the scripts in the main script and compile the whole thing – Theo Feb 28 '22 at 15:37
-
How should i do? Writing everything in one file? – Dennis Feb 28 '22 at 16:11
-
Yep, I guess that's the best way.. – Theo Feb 28 '22 at 17:24
-
Perhaps [this answer](https://stackoverflow.com/a/59288784/45375) helps. – mklement0 Feb 28 '22 at 20:44
-
I merged everything into one file. The solution proposed in the link of mklement0 is interesting, but in my case I don't have to execute scripts in sequence, and I need to pass parameters to the functions. Thanks a lot to everyone. – Dennis Mar 01 '22 at 21:17
-
Does this answer your question? [How to include another powershell script file inside of another powershell script?](https://stackoverflow.com/questions/65149351/how-to-include-another-powershell-script-file-inside-of-another-powershell-scrip) – Metro Smurf Nov 28 '22 at 15:12