Call powershell script in post-built with parameters

前端 未结 5 782
慢半拍i
慢半拍i 2021-01-05 07:33

I\'m trying to get Powershell to run my PS script in post built - but somehow it doesn\'t work like it\'s supposed to:

Following command in Post-Build:



        
5条回答
  •  再見小時候
    2021-01-05 08:28

    (This thread is not new, but I got here from Google, so I thought sharing the solution I found would be interesting to others)

    I tried changing the path to powershell.exe to "%WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe" and it worked perfect. The 64 bits version is called from the Post Build event and it successfully adds the SharePoint snapin.

    Credits to this article: http://msdn.microsoft.com/en-us/library/ff798298.aspx, "Using Windows PowerShell Scripts to Automate Tasks in Visual Studio".

提交回复
热议问题