private/Adf.class.ps1
class AdfGlobalProp { [string] $FilePath = "" [string] $body = "" [PSCustomObject] $GlobalParameters } class Adf { [string] $Name = "" [string] $ResourceGroupName = "" [string] $Region = "" [System.Collections.ArrayList] $Pipelines = @{} [System.Collections.ArrayList] $LinkedServices = @{} [System.Collections.ArrayList] $DataSets = @{} [System.Collections.ArrayList] $DataFlows = @{} [System.Collections.ArrayList] $Triggers = @{} [System.Collections.ArrayList] $IntegrationRuntimes = @{} [System.Collections.ArrayList] $Factories = @{} [string] $Location = "" [AdfGlobalProp] $GlobalFactory = [AdfGlobalProp]::new() [System.Collections.ArrayList] AllObjects() { return $this.LinkedServices + $this.Pipelines + $this.DataSets + $this.DataFlows + $this.Triggers + $this.IntegrationRuntimes + $this.Factories } [hashtable] GetObjectsByFullName([string]$pattern) { [hashtable] $r = @{} $this.AllObjects() | ForEach-Object { $oname = $_.FullName($false); if ($oname -like $pattern) { $null = $r.Add($oname, $_) } } return $r } [hashtable] GetObjectsByFolderName([string]$folder) { [hashtable] $r = @{} $this.AllObjects() | ForEach-Object { $ofn = $_.GetFolderName() if ($ofn -like $folder) { $oname = $_.FullName($false); $null = $r.Add($oname, $_) } } return $r } } |