简体   繁体   中英

AWS beanstalk not able to execute powershell script

I am trying to deploy my .net core (2.0.0) application on aws beanstalk. According to aws guidelines ( https://aws.amazon.com/blogs/developer/aws-and-net-core-2-0/ ) I have added the powershell script file and the location of the script file in deployment menifest. But when I am deploying my app, I am getting this error:

Error messages running the command: C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy unrestricted -NonInteractive -NoProfile -Command "& { & \\"C:\\staging./Scripts/installnetcore20.ps1"; exit $LastExitCode }" & : The term '"C:\\staging./Scripts/installnetcore20.ps1"' is not recognized as the name of a cmdlet, function, script file, or operable program.

I also tried changing the various combination of path in my menifest file such as giving an absolute path, putting dot before the path and all.

Any help on this is appreciated.

The beanstalk AMIs have been updated with .NET Core 2.0 preinstalled so you shouldn't need to run this powershell script anymore. Here is that announcement for that.

https://aws.amazon.com/blogs/developer/aws-elastic-beanstalk-updated-with-net-core-2-0/

My guess what is going wrong for you is the script files are not marked in the project file as content files to be copied to the output folder. Then they wouldn't be included in the publishing bundle.

Before
'"C:\staging./Scripts/installnetcore20.ps1"'
After
'"C:\staging/Scripts/installnetcore20.ps1"'

Remove the dot after staging. ? And for God sakes get your slashes all going the same way ? It's making my face twitch. (although I'm pretty sure Windows handles this ok)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM