I can create an api using powershell as follows

```
New-AzureRmApiManagementApi -Context $azContext -ApiId $apiId -Name $apiName -ServiceUrl "https://myapp-dev-apims.azure-api.net/${subDomainName}" -Protocols @("https") -Path $subDomainName

```

However, this cmdlet does not create a version. It appears I need to use 

```
New-AzureRmApiManagementApiVersionSet

```

However, Its not well documented how to do this when looking to add a version using a path segment such as myApi.com/cart/v1.

When creating the version within the portal, it says "Versioning creates a new API. This new API is linked to your existing API through a versioning scheme. Choose a versioning scheme and choose a version number for your API:"

Do I need to create a new api using New-AzureRmApiManagementApi, again a second time? This is confusing. 

The workaround to this is to just use the New-AzureRmApiManagementApi cmdlet to initially create the api, then go into the portal to MANUALLY create the version. But it would obviously be nice if the process of creating both the api and its version were repeatable in a script. 

Using powershell alone, how do I both create an api, and the version in one script? Help is appreciated. Thank you.