manifests/collectors/AI/MachineLearning.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/AI/MachineLearning.ps1 (AB#5660). # Field expressions are copied verbatim from the original collector and evaluate in an # equivalent scope -- see docs/design/decisions/declarative-collectors.md. # Review before trusting; regenerate rather than hand-patch if the source collector changes. # @{ ResourceTypes = @( 'microsoft.machinelearningservices/workspaces' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = '1' Preamble = @' $ResUCount = 1 $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId } $data = $1.PROPERTIES $sku = $1.SKU $timecreated = $data.creationTime $timecreated = [datetime]$timecreated $timecreated = $timecreated.ToString("yyyy-MM-dd HH:mm") $Retired = Foreach ($Retirement in $Retirements) { if ($Retirement.id -eq $1.id) { $Retirement } } if ($Retired) { $RetiredFeature = foreach ($Retire in $Retired) { $RetiredServiceID = $Unsupported | Where-Object {$_.Id -eq $Retired.ServiceID} $tmp0 = [pscustomobject]@{ 'RetiredFeature' = $RetiredServiceID.RetiringFeature 'RetiredDate' = $RetiredServiceID.RetirementDate } $tmp0 } $RetiringFeature = if (@($RetiredFeature.RetiredFeature).count -gt 1) { $RetiredFeature.RetiredFeature | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredFeature} $RetiringFeature = [string]$RetiringFeature $RetiringFeature = if ($RetiringFeature -like '* ,*') { $RetiringFeature -replace ".$" }else { $RetiringFeature } $RetiringDate = if (@($RetiredFeature.RetiredDate).count -gt 1) { $RetiredFeature.RetiredDate | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredDate} $RetiringDate = [string]$RetiringDate $RetiringDate = if ($RetiringDate -like '* ,*') { $RetiringDate -replace ".$" }else { $RetiringDate } } else { $RetiringFeature = $null $RetiringDate = $null } $StorageAcc = $data.storageAccount.split('/')[8] $KeyVault = $data.keyVault.split('/')[8] $Insight = $data.applicationInsights.split('/')[8] $containerRegistry = $data.containerRegistry.split('/')[8] $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'} '@ AdditionalRowLoops = @() TagLoop = @{ Variable = 'Tag' Source = '$Tags' Preamble = '' } Fields = @( @{ Name = 'ID' Expression = '$1.id' } @{ Name = 'Subscription' Expression = '$sub1.Name' } @{ Name = 'Resource Group' Expression = '$1.RESOURCEGROUP' } @{ Name = 'Name' Expression = '$1.NAME' } @{ Name = 'Location' Expression = '$1.LOCATION' } @{ Name = 'SKU' Expression = '$sku.name' } @{ Name = 'Retiring Feature' Expression = '$RetiringFeature' } @{ Name = 'Retiring Date' Expression = '$RetiringDate' } @{ Name = 'Friendly Name' Expression = '$data.friendlyName' } @{ Name = 'Description' Expression = '$data.description' } @{ Name = 'HBI Workspace' Expression = '$data.hbiWorkspace' } @{ Name = 'Container Registry' Expression = '$containerRegistry' } @{ Name = 'Storage HNS Enabled' Expression = '$data.storageHnsEnabled' } @{ Name = 'Private Link Count' Expression = '$data.privateLinkCount' } @{ Name = 'Public Access Behind Vnet' Expression = '$data.allowPublicAccessWhenBehindVnet' } @{ Name = 'Discovery Url' Expression = '$data.discoveryUrl' } @{ Name = 'ML Flow Tracking Uri' Expression = '$data.mlFlowTrackingUri' } @{ Name = 'Storage Account' Expression = '$StorageAcc' } @{ Name = 'Key Vault' Expression = '$KeyVault' } @{ Name = 'Created Time' Expression = '$timecreated' } @{ Name = 'Application Insight' Expression = '$Insight' } @{ Name = 'Resource U' Expression = '$ResUCount' } @{ Name = 'Tag Name' Expression = '[string]$Tag.Name' } @{ Name = 'Tag Value' Expression = '[string]$Tag.Value' } ) Export = @{ WorksheetName = 'Machine Learning' TableNamePrefix = 'AzureMLTable_' Columns = @( 'Subscription' 'Resource Group' 'Name' 'Location' 'SKU' 'Retiring Feature' 'Retiring Date' 'Friendly Name' 'Description' 'HBI Workspace' 'Container Registry' 'Storage HNS Enabled' 'Private Link Count' 'Public Access Behind Vnet' 'Discovery Url' 'ML Flow Tracking Uri' 'Storage Account' 'Key Vault' 'Application Insight' 'Created Time' 'Resource U' ) TagColumns = @( 'Tag Name' 'Tag Value' ) TagColumnsBefore = 'Resource U' NumberFormat = '0' ConditionalText = @( 'New-ConditionalText -Range F2:F100 -ConditionalType ContainsText' ) } SourceCollector = 'Modules/Public/InventoryModules/AI/MachineLearning.ps1' } |