dbondarev
dbondarev

Reputation: 75

Run Powershell script on TFS server for publish to Azure

I try to configure TFS for Continuous Delivery to Azure by this article In article TFS published package to Azure with Powershell script. When build starts I get errors like ObjectNotFound: (Set-AzureDeployment:String) [], CommandNotFoundException. Looks like I didn't install Azure cmdlets, but I install all from Web Platform Installer. And when I try to run script locally on server - it works and deploys package.

In article Powershell starts by adding InvokeProcess to template with Filename="PowerShell".

I think I just don't run Powreshell correctly. Maybe somebody has some ideas which command should I use?

Upvotes: 0

Views: 566

Answers (2)

dbondarev
dbondarev

Reputation: 75

Find a solution

Powershell cann't find Azure module. Add this before Import-Module Azure command in script

$env:PSModulePath=$env:PSModulePath+";"+"C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell"

Upvotes: 2

Giulio Vian
Giulio Vian

Reputation: 8353

Could be that you installed the cmdlets on the user profile. Try re-install after logging in with the account running the build service.

Upvotes: 0

Related Questions