File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed
src/ResourceManager/OperationalInsights
Commands.OperationalInsights
DataSources/NewDataSourceCmdletsPerKind
Commands.OperationalInsights.Test/ScenarioTests Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 1916
1916
<Component Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" Guid="*">
1917
1917
<File Id="filF30732FD3174ABEC7D2103467F25E8E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\AzureRM.OperationalInsights.psd1" />
1918
1918
</Component>
1919
+ <Component Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" Guid="*">
1920
+ <File Id="filD2FB04719F134FB9BF2BC1EE41908381" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
1921
+ </Component>
1919
1922
<Component Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" Guid="*">
1920
1923
<File Id="filD490745C6F4007A53448F93D7655F3D4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Hyak.Common.dll" />
1921
1924
</Component>
6071
6074
<ComponentRef Id="cmp275E5D23204FF3DB5A484691FFA2C6F5" />
6072
6075
<ComponentRef Id="cmp5E9A44B7330C75772463CB17D6D24AA6" />
6073
6076
<ComponentRef Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" />
6077
+ <ComponentRef Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" />
6074
6078
<ComponentRef Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" />
6075
6079
<ComponentRef Id="cmp6D68CAF3787D43356F3C2CB592699D2D" />
6076
6080
<ComponentRef Id="cmp20FBC1203D91D529F69E519C9C2F78B8" />
Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ function Test-DataSourceCreateUpdateDelete
48
48
Assert-AreEqual $subId1 $dataSource.Properties.SubscriptionId
49
49
Assert-AreEqual " AzureActivityLog" $dataSource.Kind
50
50
51
- # Create a second data source for list testing
51
+ # Create a second data source for list testing, also cover the alias.
52
52
$daNametwo = Get-ResourceName
53
- $dataSource = New-AzureRmOperationalInsightsAzureActivityLogDataSource - Workspace $workspace - Name $daNametwo - SubscriptionId $subId2
53
+ $dataSource = New-AzureRmOperationalInsightsAzureAuditDataSource - Workspace $workspace - Name $daNametwo - SubscriptionId $subId2
54
54
55
55
# List the data source in the workspace (both param sets)
56
56
$dataSources = Get-AzureRmOperationalInsightsDataSource - Workspace $workspace - Kind AzureActivityLog
Original file line number Diff line number Diff line change 235
235
<SubType >Designer</SubType >
236
236
</Content >
237
237
<None Include =" MSSharedLibKey.snk" />
238
+ <Content Include =" OperationalInsightsStartup.ps1" >
239
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
240
+ </Content >
238
241
<None Include =" packages.config" >
239
242
<SubType >Designer</SubType >
240
243
</None >
Original file line number Diff line number Diff line change 12
12
// limitations under the License.
13
13
// ----------------------------------------------------------------------------------
14
14
15
+ using Microsoft . Azure . Commands . Common . Authentication ;
15
16
using Microsoft . Azure . Commands . OperationalInsights . Models ;
16
17
using Microsoft . Azure . Commands . OperationalInsights . Properties ;
18
+
17
19
using System ;
20
+ using System . IO ;
18
21
using System . Linq ;
22
+ using System . Reflection ;
19
23
using System . Management . Automation ;
20
24
21
25
namespace Microsoft . Azure . Commands . OperationalInsights
@@ -68,5 +72,27 @@ public override void ExecuteCmdlet()
68
72
69
73
CreatePSDataSourceWithProperties ( auditLogProperties ) ;
70
74
}
75
+
76
+
77
+ /// <summary>
78
+ /// Load global aliases for ARM
79
+ /// </summary>
80
+ public void OnImport ( )
81
+ {
82
+ try
83
+ {
84
+ System . Management . Automation . PowerShell invoker = null ;
85
+ invoker = System . Management . Automation . PowerShell . Create ( RunspaceMode . CurrentRunspace ) ;
86
+ invoker . AddScript ( File . ReadAllText ( FileUtilities . GetContentFilePath (
87
+ Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ,
88
+ "OperationalInsightsStartup.ps1" ) ) ) ;
89
+ invoker . Invoke ( ) ;
90
+ }
91
+ catch
92
+ {
93
+ // This will throw exception for tests, ignore.
94
+ }
95
+
96
+ }
71
97
}
72
98
}
Original file line number Diff line number Diff line change
1
+ # ----------------------------------------------------------------------------------
2
+ #
3
+ # Copyright Microsoft Corporation
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ # ----------------------------------------------------------------------------------
14
+
15
+ @ {
16
+ " New-AzureRmOperationalInsightsAzureAuditDataSource" = " New-AzureRmOperationalInsightsAzureActivityLogDataSource" ;
17
+ }.GetEnumerator() | Select @ {Name = ' Name' ; Expression = {$_.Key }}, @ {Name = ' Value' ; Expression = {$_.Value }} | New-Alias - Description " AzureAlias"
You can’t perform that action at this time.
0 commit comments