How to know the name of the directory in which I run a powershell script? My code is as follows:
$usuario = $env:USERPROFILE
[Reflection.Assembly]::LoadFile("$usuario\Desktop\"nombre de la carpeta"\lib.dll")
I want to put a variable in the "folder name" that takes me the name of the current folder where I execute the script as it would be !!! I've looked with the environment variables but I can't find any that work for me.
Use the automatic variable:
Inside a file
.ps1
will return the path from where the file is located.ps1