• 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

Comments

Yaplex - Freelance developer - white logo on black background

Yaplex is an IT Consulting and .NET development company co-founded by freelance developer Alex Shapovalov who lives in Canada and provides software development services in Canada, USA and all over the world.

Contact Information

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