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


Social media


Latest Tweets