0
votes

I am following the below article to Deploy ASP.NET apps to Azure virtual machines. https://www.visualstudio.com/en-us/docs/release/examples/azure/net-to-azure-vm#build

I am getting below error:

##[error]System.Management.Automation.RuntimeException: The term 'C:\temp\ConfigureWebserver.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. ---> System.Management.Automation.RuntimeException: The term 'C:\temp\ConfigureWebserver.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

If I manually copy the ConfigureWebserver.ps1 file in the VM and then deploy the build,then it is able to successfully deploy.

1
Can you clarify what you mean by "If I manually copy the ConfigureWebserver.ps1 file in the VM and then deploy the build,then it is able to successfully deploy." - Adrian Sanguineti
are you sure you didn't forget the Set the Copy to Output Directory property of the file to Copy Always right before the build step? - baywet

1 Answers

0
votes

Use the Windows Machine File Copy or the Azure File Copy task to copy the script to the VM prior to attempting to run it.