Thursday 15 March 2012

powershell - The term 'xsd' is not recognized as the name of a cmdlet, function, script file, or operable program -



powershell - The term 'xsd' is not recognized as the name of a cmdlet, function, script file, or operable program -

when executing next script (this part of actual script), i'm getting next error message in powershell:

the term 'xsd' not recognized name of cmdlet, function, script file, or operable program. check spelling of name, or if path included, verify path right , seek again. @ line:10 char:3

$xsds = ls *.xsd | %{ $_.name } if ($xsds.count -eq 0) { exit } # add together '.\' lastly 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

are there requirements powershell need install able run 'xsd' cmdlet first?

the output of $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>

an xsd.exe available in folders:

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

the paths have listed not part of path environment variable. leaves 2 options. add together directories path or reference exe total path.

& "c:\program files (x86)\microsoft sdks\windows\v8.1a\bin\netfx 4.5.1 tools\xsd.exe" $xsds /c /n:outputfolder

if want alter paths update them this

$env:path += ";c:\program files (x86)\microsoft sdks\windows\v8.1a\bin\netfx 4.5.1 tools"

if need x64 paths update strings.

powershell xsd cmdlet

No comments:

Post a Comment