I am able to create manually from admin.powerapps.com with same user and failed to achieve the same with PS cmdlet.
could you please suggest, what i have done wrong here in the below code..
#Install the Online Management API to the current user profile
install-module Microsoft.Xrm.OnlineManagementAPI -Scope CurrentUser -force
#interactive prompt
$cred = Get-Credential
Import-Module Microsoft.Xrm.OnlineManagementAPI -Verbose
#get instance info
$instances = Get-CrmInstances -Credential $cred -ApiUrl $apiUrl -verbose
#retrieve all the current deployed versions of Dynamics 365
$Versions = Get-CrmServiceVersions -ApiUrl $apiUrl -Credential $cred
#find version
$v9dot0 = $Versions | where Version -like "9.0"
#now create new instance information for our new instance that we wish to create
$instanceInfo = New-CrmInstanceInfo -BaseLanguage 1033 -ServiceVersionId $v9dot0.Id -InstanceType Sandbox -DomainName Test_DN_4_POC -InitialUserEmail <<valid emaild>> -FriendlyName "TestFN_POC" -CurrencyCode 840 -CurrencyName USD -CurrencyPrecision 2 -CurrencySymbol $ -Purpose "Test Env POC with Powershell" -SecurityGroupId <<Security Group Object ID>>
#create that new instance using the info from above
$newInstance = New-CrmInstance -ApiUrl $apiUrl -Credential $cred -NewInstanceInfo $instanceInfo -Verbose
$OperationId = $newInstance.OperationId
$OperationStatus = $newInstance.Status
Write-Output "the instance id is: $OperationId"
Thank you in advance!!