skip to Main Content

PowerShell command to Create the target resource settings object for a VM in Azure

I am trying to run PowerShell script to Create the target resource settings object for a VM. But it's throwing error : PS /home/user> $targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings New-Object: Cannot find type [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings]: verify that the assembly containing this type…

VIEW QUESTION

Python call Powershell Invoke-RestMethod with Json as string into Body

import requests import subprocess import base64 credentials = "login:password" url = f'urlXXXurl' body = '{"id": 4986986, "key": "2df534ee-270b-4ab4-83fb-1b308febacce", ...}' headers = '"""@{Authorization = 'Basic %s'}"""' % base64.b64encode(credentials.encode("ascii")).decode("ascii") command = 'powershell.exe Invoke-RestMethod -Method Post -Uri %s -ContentType application/json -Body """%s""" -Headers…

VIEW QUESTION
Back To Top
Search