Executing Powershell Script In C# Azure Function RRS feed

  • Question

  • Hello,

    I'm trying to execute a PowerShell script from my C# Azure Function.  I've referenced the Microsoft.PowerShell.SDK NuGet package and I'm targeting a 2.0 Azure Function app.

    When I execute my function I'm getting the following error message which I'm interpreting that this is not compatible with Azure 2.0 Functions for some reason?  Does anyone know how to execute a PowerShell script from a C# Azure Function?

    [10/1/2018 3:14:41 PM] System.Private.CoreLib: Exception while executing function: Function1. PowerShellInFunction: Could not load file or assembly 'System.Management.Automation, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.


    Monday, October 1, 2018 3:20 PM

All replies

  • Hey Ryan_Ha Did you migrate from v1? I would review discussions here and try the suggestions. 
    Tuesday, October 2, 2018 3:16 AM
  • Hi Ryan_Ha - any updates on this?
    Tuesday, October 16, 2018 12:34 AM
  • Thanks Mike, I unfortunately gave up on this, and switched architectures, so I never followed back up on this.  I don't know what the issue was.  Thanks though.
    Tuesday, October 16, 2018 3:54 PM