Make sure you have latest version of PowerShell Installed. To know version of PowerShell installed below is the command.
To Check Current Version of PS on the portal upgrade it if you have Lower Version. Below is the link for latest version of PowerShell download.
Latest PowerShell Download Link
Check PowerShell Execution Policy and Change it to RemotelySigned if is restricted.Below is the PowerShell command to check Execution Policy.
Command to change Execution Policy to Remotesigned Set-ExecutionPolicy RemoteSigned
Check Current ExecutionPolicy once again using Get-ExecutionPolicy Command.
Next Step is to Install Azure PowerShell modules, Azure PowerShell is moved from AzureRM to AZ command lets.Below is command to install Azure AZ PowerShell Modules.
Install-Module -Name az –AllowClobbercommand.
Get-InstalledModule -Name AZ