• Home /
  • Blog /
  • PowerShell: How to get execution folder
Learning Powershell With Yaplex

PowerShell: How to get execution folder

Recently I explained how to install windows service using PowerShell, and path to binary file was hardcode in my sample, which is not very good, because you have to remember to change it if you decide to use different installation folder . There is a solution how to detect execution folder where you run your PowerShell script, in that case it does not matter where is your binaries located, you just run your install script and it detect execution folder automatically.

So you will modify your script and it will look like this


Yaplex - Freelance developer - white logo on black background

Yaplex is a custom software development company co-founded by full-stack .NET Software developer Alex Shapovalov who lives in Mississauga, ON and provides software development services in Mississauga and GTA.

Contact Information

Mississauga, ON, Canada
Phone: +1 647 328 3809
Email: alex@yaplex.com