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 &quot;&amp; { . \&quot;$(sourcedir)myscript.ps1\&quot;; }&quot;"        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

Popular posts from this blog

php - mysql multiple keyword search in any order -

routing - AngularJS State management ->load multiple states in one page -

unity3d - Problems porting a GLSL shadertoy shader to unity -