Skip to content
Merged
Prev Previous commit
Next Next commit
update tests
  • Loading branch information
yaotongms committed Nov 7, 2024
commit 9f7a3747c8393bbf69666624aac18508ca595f54
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
### Example 1: {{ Add title here }}
### Example 1: Get ESU license profile for a machine
```powershell
{{ Add code here }}
Get-AzConnectedLicenseProfile -MachineName WIN-89LGOPE94T3 -ResourceGroupName edyoung
```

```output
{{ Add output here (remove the output block if the example doesn't have an output) }}
AdditionalInfo :
Code :
Detail :
EsuProfileAssignedLicense :
EsuProfileAssignedLicenseImmutableId :
EsuProfileEsuEligibility : Ineligible
EsuProfileEsuKey :
EsuProfileEsuKeyState : Inactive
EsuProfileServerType : Datacenter
Id : /subscriptions/********-****-****-****-**********/resourceGroups/edyoung/p
roviders/Microsoft.HybridCompute/machines/WIN-89LGOPE94T3/licenseProfiles/de
fault
Location : centraluseuap
Message :
Name : default
ProductProfileBillingEndDate :
ProductProfileBillingStartDate :
ProductProfileDisenrollmentDate :
ProductProfileEnrollmentDate :
ProductProfileProductFeature :
ProductProfileProductType :
ProductProfileSubscriptionStatus :
ProvisioningState : Succeeded
ResourceGroupName : edyoung
SoftwareAssuranceCustomer :
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tags : {
}
Target :
Type : Microsoft.HybridCompute/machines/licenseProfiles
```

{{ Add description here }}
Get ESU license profile for a machine

### Example 2: {{ Add title here }}
```powershell
{{ Add code here }}
```

```output
{{ Add output here (remove the output block if the example doesn't have an output) }}
```

{{ Add description here }}

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"Get-AzConnectedLicenseProfile+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/b24cc8ee-df4f-48ac-94cf-46edf36b0fae/resourceGroups/edyoung/providers/Microsoft.HybridCompute/machines/WIN-89LGOPE94T3/licenseProfiles/default?api-version=2024-07-31-preview+1": {
"Request": {
"Method": "GET",
"RequestUri": "https://management.azure.com/subscriptions/b24cc8ee-df4f-48ac-94cf-46edf36b0fae/resourceGroups/edyoung/providers/Microsoft.HybridCompute/machines/WIN-89LGOPE94T3/licenseProfiles/default?api-version=2024-07-31-preview",
"Content": null,
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "1" ],
"x-ms-client-request-id": [ "9c6a2f96-eb18-4c7d-9c8b-ed76c4c2c5eb" ],
"CommandName": [ "Get-AzConnectedLicenseProfile" ],
"FullCommandName": [ "Get-AzConnectedLicenseProfile_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
"User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.4.6", "Az.ConnectedMachine/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
}
},
"Response": {
"StatusCode": 200,
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "1099" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-request-id": [ "47caa7ce-b1ef-47df-b85c-0b885b32b8f8" ],
"x-ms-ratelimit-remaining-subscription-global-reads": [ "16499" ],
"x-ms-correlation-request-id": [ "075a2a5a-7535-4d3d-8bce-2da3ba377961" ],
"x-ms-routing-request-id": [ "EASTUS2:20241107T172437Z:075a2a5a-7535-4d3d-8bce-2da3ba377961" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: C9186304A5CF4B7C95E3F2700E3A1E10 Ref B: MNZ221060618039 Ref C: 2024-11-07T17:24:36Z" ],
"Date": [ "Thu, 07 Nov 2024 17:24:36 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "431" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"id\":\"/subscriptions/b24cc8ee-df4f-48ac-94cf-46edf36b0fae/resourceGroups/edyoung/providers/Microsoft.HybridCompute/machines/WIN-89LGOPE94T3/licenseProfiles/default\",\"name\":\"default\",\"location\":\"centraluseuap\",\"type\":\"Microsoft.HybridCompute/machines/licenseProfiles\",\"properties\":{\"provisioningState\":\"Succeeded\",\"esuProfile\":{\"serverType\":\"Datacenter\",\"esuEligibility\":\"Ineligible\",\"esuKeyState\":\"Inactive\"},\"productProfile\":{}}}",
"isContentBase64": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzConnectedLicenseProfile'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzConnectedLicenseProfile.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}

Describe 'Get-AzConnectedLicenseProfile' {
It 'Get' {
$all = @(Get-AzConnectedLicenseProfile -MachineName $env.MachineNameProfile -ResourceGroupName $env.ResourceGroupNameProfile)
$all | Should -Not -BeNullOrEmpty
}
}
Loading