cloudsing 스크립트를 통해 windows ec2 서버를 설정해야합니다. 레이블을 추가하고 디스크 드라이브를 특정 형식으로 포맷하는 powershell 스크립트가 있습니다.Powershell 스크립트는 서버에서 작동하지만 cloudformation으로는 작동하지 않습니다. cfn-init 함수
문제는이 파워 쉘 스크립트가 cloudformation의 CFN 기능에서 전화를받을 때
a-label-format-drives-sql output: At C:\cfn\scripts\Label-and-Format-drives.ps1:44 char:35
+ $ErrorActionPreference = "Stop"
+ ~
The string is missing the terminator: ".
At C:\cfn\scripts\Label-and-Format-drives.ps1:36 char:5
+ {
+ ~
Missing closing '}' in statement block.
At C:\cfn\scripts\Label-and-Format-drives.ps1:27 char:19
+ $LablenFormatPs={
+ ~
Missing closing '}' in statement block.
At C:\cfn\scripts\Label-and-Format-drives.ps1:19 char:5
+ try {
+ ~
Missing closing '}' in statement block.
At C:\cfn\scripts\Label-and-Format-drives.ps1:64 char:1
+
The Try statement is missing its Catch or Finally block.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
(로그에서) 그러나 동일한 스크립트를 직접 같은 창에서 PowerShell 콘솔에서 실행 될 때 완벽하게 실행 EC2와 같은 오류를 제공하다 벌금. 나는이 poweshell 스크립트를 s3 bucket에 업로드했고, 그것을 cloudflow에서 가져 와서 ec2 인스턴스에 저장했다.
여기 내 전체 스크립트입니다. https://gist.github.com/rturam/c969e161b4089ac62d89b8ba5d1d1612
로그는 무엇을 표시합니까? –
의 붙여 넣기. – ExploringApple