2012-04-03 3 views
-1

필자는 powershell 스크립트를 작성하여 팀 동료에게 보냈습니다.64 비트 컴퓨터에서 powershell 스크립트를 실행하는 방법은 무엇입니까?

내 동료 중 하나가 마우스 오른쪽 버튼을 클릭하고 [PowerShell로 실행]하면 작동하지 않는 스크립트가 실행됩니다.

그는 Win7 64 비트 시스템이라고 말했습니다.

그럼 수동으로 32 비트 Powershell을 열고 "Powershell -file <Filename>"을 사용하고 실행했습니다.

64 비트 환경에서 마우스 오른쪽 버튼을 클릭하고 PowerShell로 실행하면 간단히 실행할 수 있습니까?

+0

스크립트 사용하여 ComObject? –

+0

@Christian : PowerCLI 스냅인을 사용하고 있습니다. 이것은 나의 첫 번째 라인 "Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue"입니다. 나는 당신의 대답을 적용했지만 여전히 실패합니다. PowerShell로 마우스 오른쪽 버튼을 클릭하여 실행하면 사라집니다. (Powershell_ise에서 실행하면 간단히 실패 함) – Samselvaprabu

+0

'Add-PSSnapin VMware.VimAutomation.Core'명령이 콘솔에서 실행됩니까? –

답변

4

스크립트가 스크립트에서 시작이 추가 유일한 x86 아키텍처에서 실행할 수있는 어떤 이유로 경우 :

if ($env:Processor_Architecture -ne "x86") 
{ 
     write-warning "Running PowerShell x86" 
     &"$env:windir\syswow64\windowspowershell\v1.0\powershell.exe" -noninteractive -noprofile -file $myinvocation.Mycommand.path -executionpolicy bypass 
     exit 
} 
+0

http://stackoverflow.com/questions/4647429/powershell-on-windows-7-set-executionpolicy-for-regular-users 실제 문제는 링크에서 언급 한 것과 같습니다. 그것은 내 문제를 해결했다. – Samselvaprabu

관련 문제