Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

412
Views
Use el comando 'Connect-AzAccount' de PowerShell en C#

Quiero conectarme a Azure de la misma manera que inicio sesión con los comandos de Powershell. Como no he encontrado ninguna API para hacer eso con .NET, pensé que una buena idea sería ejecutar scripts de PS con .NET.

Ya instalé el Powershell para azure en mi computadora portátil

 Install-Module -Name Az -AllowClobber

También traté de usar el comando 'Connect-AzAccount' solo con Windows Powershell de mi PC y funciona bien.

Entonces, probé lo siguiente en Visual Studio:

 using System.Management.Automation; namespace AzureTestVM { class Program { static void Main(string[] args) { PowerShell ps = PowerShell.Create().AddCommand("Connect-AzAccount"); ps.Invoke(); } } }

El problema es que me sale el siguiente error:

 Unhandled Exception: System.Management.Automation.CmdletInvocationException: Method 'get_SerializationSettings' on type' Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient 'of assembly' Microsoft.Azure.PowerShell.Clients.ResourceManager, Version = 1.0. 0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 'does not have an implementation. ---> System.TypeLoadException: Method 'get_SerializationSettings' on type' Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient 'of assembly' Microsoft.Azure.PowerShell.Clients.ResourceManager, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 'does not have an implementation.
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!