skip to Main Content

running powershell command via ARM template throws "The term 'Connect-AzureAD' is not recognized as a name of a cmdlet" error

I am trying to execute the following powershell script via Azure ARM template (snippet below), Install-Module -Name AzureAD -force Import-Module -Name AzureAD -UseWindowsPowerShell -RequiredVersion 2.0.2.89 -force $SecurePassword = ConvertTo-SecureString $password -AsPlainText -Force $credentials = New-Object System.Management.Automation.PSCredential($username, $SecurePassword) Connect-AzureAD -Credential $credentials…

VIEW QUESTION

powershell add key value to the json

I have the using the REST API to get the result, then I get the Json file, ApiConnectionjson: $token = $(Token) $header = @{authorization = "Bearer $token"} $url = "https://management.azure.com/xxxx?api-version=2018-07-01-preview" $result = Invoke-RestMethod -Uri $url -Method Get -ContentType "application/json" -Headers…

VIEW QUESTION

Combine one JSON to another json objects in PowerShell

I have two json files, and I want to combine one json file as object to another json file. My first C1 json like: { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "connections_TestValue_name": { "defaultValue": "TestValue", "type": "String" } }, "variables":…

VIEW QUESTION

Azure – assign license with MsGraph

I need to assign license using MsGraph-if you are here, you know it will be obsolete by the end of March. So far, I found this. $AddLicense = @( @{SkuID = $license DisabledPlans = $DisabledPlans}) Set-MgUserLicense -UserID $upn -AddLicenses $AddLicense…

VIEW QUESTION
Back To Top
Search