2016-08-04 22 views
1
Get-SqlInstances : The term 'Get-SqlInstances' 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 C:\Users\amitk.yadav\desktop\BLDiscover_check_SQLInvtInfo.ps1:88 char:1 
+ Get-SqlInstances $server >> $OUTPUT_DIR\InstanceList.txt # listing all sql inst ... 
+ ~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (Get-SqlInstances:String) [], CommandNotFoundException 
    + FullyQualifiedErrorId : CommandNotFoundException 

Get-Content : Cannot find path 'C:\Temp\InstanceList.txt' because it does not exist. 
At C:\Users\amitk.yadav\desktop\BLDiscover_check_SQLInvtInfo.ps1:110 char:23 
+ ForEach ($instance in Get-Content $OUTPUT_DIR\InstanceList.txt) 
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+0

は多分ほんの少し以上2つのエラーメッセージを投稿します –

答えて

1

まあ、エラーは十分に言っています。 "Get-SqlInstances"関数を認識できません。

おそらく、ISEホストプロファイルに、その機能に適切なモジュールをインポートするものがあります。

まずチェックする必要があります。 ISEのホストにおけるbeinghは、次のコマンドを実行している間:

Get-Content $($profile.AllUsersCurrentHost) 

または

Get-Content $($profile.CurrentUserCurrentHost) 
関連する問題