I want to use a powershell script in a build event in Visual Studio, and I need to use some macro defined in Visual Studio itself.
This is my powershell script sample:
"Updating version for Project:"
"$ProjectDir"
Then in pre-build event of the project I call it in this way:
powershell.exe -file "$(SolutionDir)Resources\UpdateVersion.ps1" -path $(SolutionDir)
When I build the project, I call correctly the script but the string containing the project path is empty.
Is there a way to pass all visual studio macros to the powershell script without passing them explicitly as script arguments (I must use a lot of them and it will be tedious)?