2014-11-01 2 views
0

다음 스크립트를 실행하면 (실제 스크립트의 일부 임) 다음 오류 메시지가 나타납니다. PowerShell에서 : The term 'xsd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:10 char:3'xsd'라는 단어가 cmdlet, 함수, 스크립트 파일 또는 작동 가능한 프로그램의 이름으로 인식되지 않습니다.

$xsds = ls *.xsd | %{ $_.Name } 

if ($xsds.Count -eq 0) { exit } 

# Add '.\' to last file name, see http://stackoverflow.com/questions/906093/xsd-exe-output-filename 
$last = $xsds | select -last 1 
$last = '.\' + $last 
$xsds[$xsds.Count - 1] = $last 

& xsd $xsds /c /n:OutputFolder 

내가 먼저 'XSD'cmdlet을 실행할 수 있도록 설치해야합니다 파워 쉘에 대한 몇 가지 요구 사항이 있습니까?

$env:Path의 출력 :

PS C:\Users\Administrator\Desktop\New> $env:Path 
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Mi 
crosoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files 
(x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Micro 
soft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program F 
iles (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\ 
PS C:\Users\Administrator\Desktop\New> 

xsd.exe이 폴더에 볼 수 있습니다 : 당신이 나열했습니다

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64

+0

XSD는 시스템의 exe 파일입니까? '$ env : Path'를 검사하여 그 경로가 있는지 확인할 수 있습니다. XSD는 익숙한 PowerShell cmdlet이 아닙니다. – Matt

+0

@Matt 요청한 정보를 게시물에 추가했습니다. – SeToY

+0

'xsd'는 cmdlet이 아닙니다. 오류 메시지와 마찬가지로 정확하게 알려줍니다. 오류 메시지를 믿어보십시오. –

답변

2

경로는 PATH 환경의 일부가 아닌 변하기 쉬운. 그래서 두 가지 옵션이 있습니다. 경로에 디렉토리를 추가하거나 exe를 전체 경로로 참조하십시오.

& "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\xsd.exe" $xsds /c /n:OutputFolder 

당신이 당신의 경로를 변경하려는 경우에는 64 경로 그냥 문자열을 업데이트해야 할 경우이

$env:Path += ";C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools" 

처럼 그들을 업데이트 할 수 있습니다.

관련 문제