Reputation: 37
Install-Module AzureAD
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ("[email protected]", $password)
Connect-AzureAD -Credential $Cred
This is my sample Azure Powershell script. I've run it through Windows PowerShell ISE. Is there any way to run Azure cmdlets using Visual Studio 2017? Or any Nuget Packages available for referencing the library for Azure Powershell commands?
Thanks!
Upvotes: 0
Views: 2422
Reputation: 24549
Additional for PRADEEP. We could install the Powershell tool with Visual Studio Installer. We also could install it from VS extensions and updates.
After that we could create the PowerShell project and script. We also could debug and run the scrpits in the VS.
Note: If you want to install Module, then we need to run the VS with administrator rights, or will get the error info Administrator rights are required to install modules
Upvotes: 0
Reputation: 12768
You can install PowerShell Tools from the Visual Studio Installer as an individual component or as a part of the "Azure development" workload.
To install PowerShell Tools as an individual component:
After installing click on View => Other Windows => PowerShell Interactive Window => and run your cmdlet:
Upvotes: 1