AWS CodeDeploy Powershell脚本无法创建网站&;IIS服务器中的池
我有一个应用程序正在使用AWS Codedeploy部署到运行Windows Server 2012 R2并安装了code deploy agent的EC2实例 代码修订版已成功从S3 bucket下载到EC2实例,但PowerShell脚本引发错误 仅通知您,在EC2实例中手动执行脚本时,它正在成功运行 以下是my appspec.yml&before-install.batAWS CodeDeploy Powershell脚本无法创建网站&;IIS服务器中的池,powershell,amazon-web-services,iis,windows-server-2012-r2,aws-code-deploy,Powershell,Amazon Web Services,Iis,Windows Server 2012 R2,Aws Code Deploy,我有一个应用程序正在使用AWS Codedeploy部署到运行Windows Server 2012 R2并安装了code deploy agent的EC2实例 代码修订版已成功从S3 bucket下载到EC2实例,但PowerShell脚本引发错误 仅通知您,在EC2实例中手动执行脚本时,它正在成功运行 以下是my appspec.yml&before-install.bat appspec.yml 版本:0.0 操作系统:windows 文件夹: -来源:\index.html 目标:C:
- appspec.yml
版本:0.0 操作系统:windows 文件夹: -来源:\index.html 目标:C:\DemoApp\MySite 挂钩: 安装前: -位置:\before-install.bat 超时:900
- 安装之前。bat
C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe-Command“&{Import Module WebAdministration;新项目iis:\Sites\MySite-bindings@{protocol=\“http\”bindingInformation=\”:80:\“}-physicalPath C:\DemoApp\MySite;新项目iis:\AppPools\MyPool;Set ItemProperty iis:\Sites\MySite-name applicationPool-value MyPool;}”
if ($PSHOME -like "*SysWOW64*")
{
Write-Warning "Restarting this script under 64-bit Windows PowerShell."
& (Join-Path ($PSHOME -replace "SysWOW64", "SysNative") powershell.exe) -File `
(Join-Path $PSScriptRoot $MyInvocation.MyCommand) @args
Exit $LastExitCode
}
Import-Module WebAdministration;
New-Item IIS:\AppPools\MyPool;
New-Item iis:\Sites\MySite -bindings @{protocol='http';bindingInformation=':80:'} -physicalPath c:\DemoApp\MySite;
Set-ItemProperty IIS:\Sites\MySite -name applicationPool -value MyPool
参考