Windows Powershell - Error & Solution

Windows Powershell - Error & Solution

I faced some issue while executing powershell script on Windows Server 2012 R2, then I search on google and found solution, which I am sharing with you, which help you for quick solution...


Error: Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program.

Solution:

It seems that your powershell version is old, so you need to update it.

Follow below steps,

  1. Open url - https://www.microsoft.com/en-us/download/details.aspx?id=54616
  2. Select - Win8.1AndW2K12R2-KB3191564-x64.msu and download
  3. Install it.
  4. Now you can install-module command will work


Error: New-AzureStorageContext : The term 'New-AzureStorageContext' 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

Solution:

It seems that Azure module is not installed for Powershell command

Install it using below command, 
  1. Open Powershell window 
  2. Execute - Install-Module -Name AzureRM  -Repository PSGallery -Verbose


Error: Backup-SqlDatabase : The term 'Backup-SqlDatabase' 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.

Solution:

It seems that SQL module is not installed for Powershell command

Install it using below command, 
  1. Open Powershell window 
  2. Execute - Install-Module -Name SqlServer -Repository PSGallery -Verbose

Hope this will help you and save your time.


Enjoy !!!

:)

No comments:

Post a Comment