tfs - Cannot add powershell snapin, when executing from MSBuild project -
i have powershell script, adds snapin.
if ((get-pssnapin | select-string "microsoft.teamfoundation.powershell") -eq $null) { add-pssnapin microsoft.teamfoundation.powershell }
it works when invoking powershell command line
however, when invoke build.proj (msbuild project) using:
<exec command="powershell -executionpolicy unrestricted -command "& { . \"$(sourcedir)myscript.ps1\"; }"" logstandarderroraserror="true" continueonerror="false"/>
it says:
the windows powershell snap-in 'microsoft.teamfoundation.powershell' not installed on computer.
build.proj(82,5): error : add-pssnapin : windows powershell snap-in 'microsoft.teamfoundation.powersh build.proj(82,5): error : ell' not installed on computer.
you need install microsoft.teamfoundation.powershell snapin on build agent before can add snapin session. believe part of microsoft visual studio team foundation server 2013 power tools download.
as al-muhandis suggests in comments make sure installed in both 32-bit , 64-bit.
Comments
Post a Comment