@@ -206,8 +206,38 @@ function Update-AzApplicationInsights {
206
206
)
207
207
208
208
process {
209
+ # add PS bound parameters to run test
210
+ $EnvPSBoundParameters = @ {}
211
+ if ($PSBoundParameters.ContainsKey (' Debug' )) {
212
+ $EnvPSBoundParameters [' Debug' ] = $Debug
213
+ }
214
+ if ($PSBoundParameters.ContainsKey (' HttpPipelineAppend' )) {
215
+ $EnvPSBoundParameters [' HttpPipelineAppend' ] = $HttpPipelineAppend
216
+ }
217
+ if ($PSBoundParameters.ContainsKey (' HttpPipelinePrepend' )) {
218
+ $EnvPSBoundParameters [' HttpPipelinePrepend' ] = $HttpPipelinePrepend
219
+ }
220
+ if ($PSBoundParameters.ContainsKey (' Proxy' )) {
221
+ $EnvPSBoundParameters [' Proxy' ] = $Proxy
222
+ }
223
+ if ($PSBoundParameters.ContainsKey (' ProxyCredential' )) {
224
+ $EnvPSBoundParameters [' ProxyCredential' ] = $ProxyCredential
225
+ }
226
+ if ($PSBoundParameters.ContainsKey (' ProxyUseDefaultCredentials' )) {
227
+ $EnvPSBoundParameters [' ProxyUseDefaultCredentials' ] = $ProxyUseDefaultCredentials
228
+ }
229
+ if ($PSBoundParameters.ContainsKey (' SubscriptionId' )) {
230
+ $EnvPSBoundParameters [' SubscriptionId' ] = $SubscriptionId
231
+ }
232
+ if ($PSBoundParameters.ContainsKey (' ResourceGroupName' )) {
233
+ $EnvPSBoundParameters [' ResourceGroupName' ] = $ResourceGroupName
234
+ }
235
+ if ($PSBoundParameters.ContainsKey (' Name' )) {
236
+ $EnvPSBoundParameters [' Name' ] = $Name
237
+ }
238
+
209
239
try {
210
- $component = . Get-AzApplicationInsights - SubscriptionId $PSBoundParameters [ " SubscriptionId " ] - ResourceGroupName $PSBoundParameters [ " ResourceGroupName " ] - Name $PSBoundParameters [ " Name " ]
240
+ $component = . Get-AzApplicationInsights @EnvPSBoundParameters
211
241
} catch {
212
242
Write-Warning " component $ ( $PSBoundParameters [' Name' ]) is not existed in Resource Group $ ( $PSBoundParameters [" ResourceGroupName" ]) "
213
243
return
@@ -258,7 +288,7 @@ function Update-AzApplicationInsights {
258
288
$PSBoundParameters [" SamplingPercentage" ] = $component.SamplingPercentage
259
289
}
260
290
if (! $PSBoundParameters.ContainsKey (" Tag" ) -and ($null -ne $component.Tag )) {
261
- $PSBoundParameters [" Tag" ] = [System.Collections.Hashtable ]$component.Tag.AddtionalProperties
291
+ $PSBoundParameters [" Tag" ] = [System.Collections.Hashtable ]$component.Tag.AdditionalProperties
262
292
}
263
293
if (! $PSBoundParameters.ContainsKey (" WorkspaceResourceId" ) -and ! [System.String ]::IsNullOrEmpty($component.WorkspaceResourceId )) {
264
294
$PSBoundParameters [" WorkspaceResourceId" ] = $component.WorkspaceResourceId
0 commit comments