In PowerShell, you can return a path in a function, and then execute the resulting variable like this:
Function GetMSBuildExe {
# Code that sets the value of $MSBuildExe
Return $MSBuildExe
}
$MSBuildExe= GetMSBuildExe
&$MSBuildExe MySolution.sln
Is there a way I can simply run the MSBuildExe without copying into a variable first? Doing this simply prints ou the GetMSBuildExe result:
&GetMsBuildExe MySolution.sln
Thanks!