如何在以下html表中添加值Sku.Name
和Sku.Tier
?
$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"
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
答案 0 :(得分:2)
您需要使用计算属性:
<% b = Benchmark.measure do %>
<% cache_if m.persisted?, m do %>
<% puts '...Cache Invalidated. So Regenarated...' %>
<div class="row meeting-top">...
...
<% end -%>
<% end -%>
<% puts '-------------------------------' %>
<% puts 'Caching time:' %>
<% puts b %>
<% puts '-------------------------------' %>