2016-08-04 6 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

Может размещать только немного больше, чем два сообщения об ошибках –

ответ

1

Ну, ошибка, говорящая достаточно. Он не может распознать функцию Get-SqlInstances.

Возможно, это что-то в профиле хоста ISE, который импортирует правильный модуль для этой функции.

Необходимо сначала проверить его. В то время как beingh в ISE хоста выполнить следующие команды:

Get-Content $($profile.AllUsersCurrentHost) 

или

Get-Content $($profile.CurrentUserCurrentHost) 
Смежные вопросы