2011-09-20 4 views
1

:Appfabric 파워 쉘 오류는 "기간"은 Get-CacheStatistics '는 cmdlet의 이름으로 인식되지 않습니다 ... "나는 간단하게 다음과 같은 파워 쉘 AppFabric 명령을 호출하고있어

powershell -noexit c:\scripts\ApplyClusterConfig.ps1 

하고 스크립트가 단지 포함을 :

Get-CacheStatistics 

나는 다음과 같은 오류 받고 있어요 : 나는 everyting을했습니다

The term 'Get-CacheStatistics' is not recognized as the name of a cmdlet, funct 
ion, 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 C:\scripts\ApplyClusterConfig.ps1:1 char:20 
+ Get-CacheStatistics <<<< 
    + CategoryInfo   : ObjectNotFound: (Get-CacheStatistics:String) [], 
    CommandNotFoundException 
    + FullyQualifiedErrorId : CommandNotFoundException 

내가 Fi를 수 . 차

Set-ExecutionPolicy Unrestricted 

포함하고를 사용하여 웹에는 \ 파일을 참조하십시오 :

powershell -noexit .\ApplyClusterConfig.ps1 

과 환경 경로를 설정하면 C 포함 : \ 스크립트

을하지만 오류가 지속 유지 . 내가 모든 Google 옵션을 다 사용했기 때문에 아무도 도와 줄 수 없습니까? 감사.

답변

6

오류로 인해 cmdlet, 함수, 스크립트 파일 또는 작동 가능 프로그램으로 Get-CacheStatistics을 찾을 수 없습니다. 필요한 모듈을 준비해야합니다. 여기 AppFabric cmdlet을 실행하는 데 필요한 모듈을로드하는 방법에 대한 지침에 대한

봐 : http://msdn.microsoft.com/en-us/library/ee677295.aspx

당신은 아마 (아마 스크립트에서) 다음 수입 중 하나 이상 추가해야합니다 :

Import-Module ApplicationServer 
Import-Module distributedcacheconfiguration 
Import-Module distributedcacheadministration 

실행 정책은이 오류와 아무 관련이 없으며 스크립트를 정상적으로 실행하고 있습니다. ";-CacheStatistics을 가져 오기 모듈 DistributedCacheAdministration" 감사합니다 powershell.exe를 -noexit - 명령 다음과 같이

+0

그 일을 네, 명령을 실행 – Asterix