happy cuber Posted May 4, 2023 Share Posted May 4, 2023 Can anyone provide a Powershell example to create machine catalog with DaaS rest API? Link to comment Share on other sites More sharing options...
happy cuber Posted May 4, 2023 Author Share Posted May 4, 2023 # Create New MCfunction CreateMachineCatalog { param ( [Parameter(Mandatory=$true)] [string] $customerid, [Parameter(Mandatory=$true)] [string] $siteid, [Parameter(Mandatory=$true)] [string] $bearerToken,# [Parameter(Mandatory=$true)]# [string] $adminCredential, [Parameter(Mandatory=$true)] [string] $body ) $requestUri = "https://api-eu.cloud.com/cvad/manage/MachineCatalogs" $headers = @{ "Accept" = "application/json"; "Content-Type"="application/json"; "Authorization" = "CWSAuth Bearer=$bearerToken"; "Citrix-CustomerId" = $customerid; "Citrix-InstanceId" = $siteid; # "X-AdminCredential" = "Basic $adminCredential"; } $response = Invoke-RestMethod -Uri $requestUri -Method POST -Headers $headers -Body $body return $response}$adminCredential = ""$body = @"{ "MachineType": "Virtual", "Name": "MOBIZ-TEST-MC-001", "AllocationType": "Static", "IsRemotePC": false, "MinimumFunctionalLevel": "L7_9", "ProvisioningScheme": { "MasterImagePath": "image.folder/........", }, "PersistUserChanges": "Discard", "ProvisioningType": "MCS", "SessionSupport": "MultiSession"}"@$response = CreateMachineCatalog $Customer_id $SiteID $BearerToken $bodyThe response shows an error:Invoke-RestMethod : {"ErrorMessage":"The required parameter is not specified.rnParameter name: MachineType","SdkErrorId":"UnknownError","ErrorType":"ArgumentException","ErrorDetails"....But I have MachineType parameter there as you can see above. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now