Last post Sep 19, 2019 04:25 AM by robby32
Sep 18, 2019 06:59 AM|robby32|LINK
Sep 18, 2019 08:33 AM|Fei Han - MSFT|LINK
if i run from my app it says Set-AzLogicApp is not a recognised parameter. Do i need to wrap the second part in some sort of variable ?
I have imported the module Az.
You said you run the above Az command from your app, can you clarify more about it? And please clarify what steps you did to import the Az module, so that we can understand and analyze the issue better.
Sep 18, 2019 10:08 AM|robby32|LINK
I am trying to run change status of a logic app in Azure by using the following powershell scripting.
$arguments = @('Set-AzLogicApp -ResourceGroupName "MyResourceGroup" -Name "MyLogicAppName" -State "Disabled" -Force')
& $command $arguments
but I get the error when I run from my c# app
The specified module 'Az.LogicApp' was not loaded because no valid module file was found in any module directory. and
The term 'Set-AzLogicApp' 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
I have ran the following:
Install-Module -Name Az in powershell.
Sep 18, 2019 10:39 AM|PatriceSc|LINK
Not a PS expert but maybe you still have to use Import-Module. For now it seems a PowerShell forum could be better than an ASP.NET forum.
Not directly related but in the rare case where I called PowerShell I used rather https://blogs.msdn.microsoft.com/kebab/2014/04/28/executing-powershell-scripts-from-c/ and
in your case maybe https://stackoverflow.com/questions/6266108/powershell-how-to-import-module-in-a-runspace as well.
Sep 19, 2019 04:25 AM|robby32|LINK
Hi, thanks the first link helped with the formatting of the powershell command.