|
47 | 47 |
|
48 | 48 | # Ask for the shared functionality table |
49 | 49 | $VTable = Register-AzModule |
50 | | - |
| 50 | + |
51 | 51 | # Tweaks the pipeline on module load |
52 | 52 | $instance.OnModuleLoad = $VTable.OnModuleLoad |
53 | 53 |
|
54 | 54 | # Following two delegates are added for telemetry |
55 | 55 | $instance.GetTelemetryId = $VTable.GetTelemetryId |
56 | 56 | $instance.Telemetry = $VTable.Telemetry |
57 | | - |
| 57 | + |
| 58 | + # Delegate to sanitize the output object |
| 59 | + $instance.SanitizeOutput = $VTable.SanitizerHandler |
| 60 | + |
| 61 | + # Delegate to get the telemetry info |
| 62 | + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo |
58 | 63 |
|
59 | 64 | # Tweaks the pipeline per call |
60 | 65 | $instance.OnNewRequest = $VTable.OnNewRequest |
61 | | - |
| 66 | + |
62 | 67 | # Gets shared parameter values |
63 | 68 | $instance.GetParameterValue = $VTable.GetParameterValue |
64 | | - |
| 69 | + |
65 | 70 | # Allows shared module to listen to events from this module |
66 | 71 | $instance.EventListener = $VTable.EventListener |
67 | | - |
| 72 | + |
68 | 73 | # Gets shared argument completers |
69 | 74 | $instance.ArgumentCompleter = $VTable.ArgumentCompleter |
70 | | - |
| 75 | + |
71 | 76 | # The name of the currently selected Azure profile |
72 | 77 | $instance.ProfileName = $VTable.ProfileName |
73 | 78 |
|
74 | | - |
75 | 79 | # Load the custom module |
76 | 80 | $customModulePath = Join-Path $PSScriptRoot './custom/Az.Fleet.custom.psm1' |
77 | 81 | if(Test-Path $customModulePath) { |
78 | 82 | $null = Import-Module -Name $customModulePath |
79 | 83 | } |
80 | | - |
| 84 | + |
81 | 85 | # Export nothing to clear implicit exports |
82 | 86 | Export-ModuleMember |
83 | 87 |
|
|
97 | 101 | # Load the last folder if no profile is selected |
98 | 102 | $profileDirectory = $directories | Select-Object -Last 1 |
99 | 103 | } |
100 | | - |
| 104 | + |
101 | 105 | if($profileDirectory) { |
102 | 106 | Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" |
103 | 107 | $exportsPath = $profileDirectory.FullName |
104 | 108 | } |
105 | | - |
| 109 | + |
106 | 110 | if($exportsPath) { |
107 | 111 | Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } |
108 | 112 | $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath |
|
0 commit comments