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

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -