2016-08-04 56 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) 
相關問題