我的命令:
"7-set-up-default" : {
"command" : { "Fn::Join" : ["", [
"robocopy /move C:\\inetpub\\wwwroot\\ C:\\inetpub\\wwwroot\\Default\\\n",
"powershell \"Import-Module WebAdministration;",
"Set-ItemProperty 'IIS:\\Sites\\Default Web Site' -name physicalpath -value 'C:\\inetpub\\wwwroot\\Default\\'\""
]]},
"waitAfterCompletion" : "0"
},
这个不太有用的堆栈跟踪失败了:
Error encountered during build of config: Command 07-set-up-default failed
Traceback (most recent call last):
File "cfnbootstrap\construction.pyc", line 513, in run_config
File "cfnbootstrap\construction.pyc", line 125, in run_commands
File "cfnbootstrap\command_tool.pyc", line 113, in apply
ToolError: Command 07-set-up-default failed
2013-08-18 08:35:29,611 [ERROR] Unhandled exception during build: Command 07-set-up-default failed
Traceback (most recent call last):
File "cfn-init", line 122, in <module>
File "cfnbootstrap\construction.pyc", line 117, in build
File "cfnbootstrap\construction.pyc", line 502, in build
File "cfnbootstrap\construction.pyc", line 513, in run_config
File "cfnbootstrap\construction.pyc", line 125, in run_commands
File "cfnbootstrap\command_tool.pyc", line 113, in apply
ToolError: Command 07-set-up-default failed
但是,将我的命令直接粘贴到 cmd 窗口中可以正常工作:
robocopy /move C:\inetpub\wwwroot\ C:\inetpub\wwwroot\Default\
powershell "Import-Module WebAdministration;Set-ItemProperty 'IIS:\Sites\Default Web Site' -name physicalpath -value 'C:\inetpub\wwwroot\Default\'"
任何人都可以帮忙吗?