Доступ к вложенным имущества в командлет ConvertTo-HTML-код командлет
Как я могу добавить значение Sku.Name
и Sku.Tier
в следующую таблицу html?
$resourceGroupName = "(my resourcegroup name)"
$storageAccounts = Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName
$storageAccounts `
| ConvertTo-Html `
-property ResourceGroupName, StorageAccountName, Sku, Sku.Name, Sku.Tier, Kind, Encryption, AccessTier `
-body "<h2>List of Storage Accounts</h2>" `
-As List `
| Set-Content "temp.html"
Результат " темп.html "
List of Storage Accounts
ResourceGroupName: "(my resourcegroup name)"
StorageAccountName: "(my storage account name)"
Sku: Microsoft.Azure.Management.Storage.Models.Sku
Kind: BlobStorage
Encryption: Microsoft.Azure.Management.Storage.Models.Encryption
AccessTier: Cool
Ожидается
List of Storage Accounts
ResourceGroupName: "(my resourcegroup name)"
StorageAccountName: "(my storage account name)"
Sku: Microsoft.Azure.Management.Storage.Models.Sku
Sku.Name: StandardLRS
Sku.Tier: Standard
Kind: BlobStorage
Encryption: Microsoft.Azure.Management.Storage.Models.Encryption
AccessTier: Cool
Ошибка
Пытаюсь
-property (Sku).Name
Результат:
+ -property (Sku).Name
+ ~~~
+ CategoryInfo : ObjectNotFound: (Sku:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException