1

I followed the instruction at https://dbatools.io/offline/:

  1. download zip & unzip

  2. run $env:PSModulePath to find all the paths.

  3. copy to C:\Program Files\WindowsPowerShell\Modules.

  4. run Get-ChildItem -Recurse "C:\Program Files\WindowsPowerShell\Modules" | Unblock-File

When I try to run Export-DbaInstance -SqlInstance I got below error :

The term Export-DBAInstance is not recognized".

Any help will be appreciated.

  • When you unzipped the dbatools files, did you also follow the instructions to Once you’ve extracted the folder, make sure you rename it from dbatools-master or dbatools-development to plain o’ dbatools.? Until I did that on my test machine, I also could not find Export-DbaInstance. – Scott Hodgin Oct 3 '18 at 17:29
3

You need to import the module using import-module dbatools

See Properly importing the module

Specifying the path to the .psd1 file

hope that helps you !

Also, what Scott commented is documented in the same link you have (just read the page carefully to see if you are not missing any steps):

Once you’ve extracted the folder, make sure you rename it from dbatools-master or dbatools-development to plain o’ dbatools.

  • Folder was renamed to dbatools. – James Oct 3 '18 at 18:25
  • import-module dbatools failed with this error: Import-Module : The 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\dbatools\dbatools.psd1' module cannot be import ed because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProce ss', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion' , 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'Requ – James Oct 3 '18 at 18:27
  • What version of powershell you are using ? – Kin Shah Oct 3 '18 at 19:13
  • I found a server with powershell 4.0. I did all the steps above (including import-module dbatools). Now I can run "Export-DBALogin" but I still can't run "Export-DBAInstance". I still got the "EXport-dbainstance is not recognized" message. Very weird, appreciate your help. – James Oct 3 '18 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.