• Home /
  • Blog /
  • PowerShell: How to get execution folder
learning-powershell-with-yaplex.png

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

Get latest updates directly into your inbox


Comments

Yaplex logo white text

Yaplex is an IT Consulting and .NET development company co-founded by .NET Developer Alex Shapovalov who lives in Mississauga and provides software development services in Toronto, Mississauga, and GTA.

Contact Information

Toronto, Canada
Phone: +1 647 328 3809