Can not connect Connect- AZAccount on power shell

SF 20 Reputation points

I have tried to do the Connect -AzAccount,  got below error.

Connect-AzAccount : The term 'Connect-AzAccount' 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 line:1 char:1 

+ Connect-AzAccount 

+ ~~~~~~~~~~~~~~~~~ 

    + CategoryInfo          : ObjectNotFound: (Connect-AzAccount:String) [], CommandNotFoundException 

    + FullyQualifiedErrorId : CommandNotFoundException

After that I did some research and tried to do the following  

 Install-Module Az

Got the below error

PS C:\Windows\system32> Install-Module Az  NuGet provider is required to continue PowerShellGet requires NuGet provider version '' or newer to interact with NuGet-based repositories. The NuGet  provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\Supem Fernando\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion -Force'. Do you want PowerShellGet to install and import  the NuGet provider now? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y WARNING: Unable to download from URI '' to ''. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\\PSModule.psm1:7468 char:21 + ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ... +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac    kageProvider], Exception     + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro    vider

Tried to do the recommendation of the below URL.

But still no luck

As I am new to Power shell can someone pls help me on this.


Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,097 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lex Li (Microsoft) 3,896 Reputation points

    If you just want to try out Azure PowerShell, you can visit Azure Portal and then open Cloud Shell from the top bar, and switch from Bash to PowerShell,

    Installing it on a Windows machine can be rather tricky if you are not familiar with PowerShell,

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SF 20 Reputation points

    HI Lex,

    Thank you for the reply. I was doing self study training on AZ-700 and I was in the process of creating point to site connection. In the given article it is said that we need to create self signed certificate based on the below article.

    "Create a self-signed root certificate

    Use the New-SelfSignedCertificate cmdlet to create a self-signed root certificate. For additional parameter information, see New-SelfSignedCertificate.

    From a computer running Windows 10 or later, or Windows Server 2016, open a Windows PowerShell console with elevated privileges.

    1. Create a self-signed root certificate. The following example creates a self-signed root certificate named 'P2SRootCert' that's automatically installed in 'Certificates-Current User\Personal\Certificates'. You can view the certificate by opening certmgr.msc, or Manage User Certificates."

    Based on point number one I felt that i need to create it on the windows machine.

    So can we use a virtual machine in azure as I thingk i am going to connect form my machine to the Azure.