Skip to content

Commit 2549cf1

Browse files
authored
Merge pull request #5016 from maddieclayton/startupscripts
Create separate folder per module containing scripts to be executed on import
2 parents 14ea68a + 0ade659 commit 2549cf1

File tree

130 files changed

+333
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+333
-320
lines changed

setup/azurecmdfiles.wxi

Lines changed: 88 additions & 60 deletions
Large diffs are not rendered by default.

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands.AnalysisServices.Dataplane.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@
112112
</Compile>
113113
</ItemGroup>
114114
<ItemGroup>
115-
<None Include="AnalysisServicesDataplaneStartup.ps1">
116-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
117-
</None>
118115
<None Include="Azure.AnalysisServices.psd1">
119116
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
120117
</None>
121118
<None Include="MSSharedLibKey.snk" />
122119
<None Include="packages.config">
123120
<SubType>Designer</SubType>
124121
</None>
122+
<None Include="StartupScripts\*.ps1">
123+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
124+
</None>
125125
</ItemGroup>
126126
<ItemGroup>
127127
<EmbeddedResource Include="Properties\Resources.resx">

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands/AddAzureASAccount.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Microsoft.Azure.Commands.AnalysisServices.Dataplane
3232
[Cmdlet("Add", "AzureAnalysisServicesAccount", DefaultParameterSetName = "UserParameterSetName", SupportsShouldProcess =true)]
3333
[Alias("Login-AzureAsAccount")]
3434
[OutputType(typeof(AsAzureProfile))]
35-
public class AddAzureASAccountCommand : AzurePSCmdlet, IModuleAssemblyInitializer
35+
public class AddAzureASAccountCommand : AzurePSCmdlet
3636
{
3737
private const string UserParameterSet = "UserParameterSetName";
3838
private const string ServicePrincipalWithPasswordParameterSet = "ServicePrincipalWithPasswordParameterSetName";
@@ -189,22 +189,5 @@ public override void ExecuteCmdlet()
189189
WriteObject(asAzureProfile);
190190
}
191191
}
192-
193-
public void OnImport()
194-
{
195-
try
196-
{
197-
System.Management.Automation.PowerShell invoker = null;
198-
invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
199-
invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath(
200-
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
201-
"AnalysisServicesDataplaneStartup.ps1")));
202-
invoker.Invoke();
203-
}
204-
catch
205-
{
206-
// This will throw exception for tests, ignore.
207-
}
208-
}
209192
}
210193
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"Login-AzureAsAccount" = "Add-AzureAnalysisServicesAccount";
1717
"Restart-AzureAsInstance" = "Restart-AzureAnalysisServicesInstance";
1818
"Sync-AzureAsInstance" = "Sync-AzureAnalysisServicesInstance";
19-
}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias"
19+
}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | Set-Alias -Description "AzureAlias"

src/ResourceManager/AnalysisServices/Commands.AnalysisServices/Commands.AnalysisServices.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<None Include="packages.config">
7171
<SubType>Designer</SubType>
7272
</None>
73+
<None Include="StartupScripts\*.ps1">
74+
<!-- <CopyToOutputDirectory>Always</CopyToOutputDirectory> -->
75+
</None>
7376
</ItemGroup>
7477
<ItemGroup>
7578
<EmbeddedResource Include="Properties\Resources.resx">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#Placeholder for future scripts: Please delete this file and uncomment <CopyToOutputDirectory>Always</CopytoOutputDirectory> within the <None Include="StartupScripts\*.ps1"> block in the .csproj file.

src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
<SubType>Designer</SubType>
146146
</None>
147147
<None Include="MSSharedLibKey.snk" />
148+
<None Include="StartupScripts\*.ps1">
149+
<!-- <CopyToOutputDirectory>Always</CopyToOutputDirectory> -->
150+
</None>
148151
</ItemGroup>
149152
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
150153
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#Placeholder for future scripts: Please delete this file and uncomment <CopyToOutputDirectory>Always</CopytoOutputDirectory> within the <None Include="StartupScripts\*.ps1"> block in the .csproj file.

src/ResourceManager/ApplicationInsights/Commands.ApplicationInsights/Commands.ApplicationInsights.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ApplicationInsights.0.1.1-preview\lib\net452\Microsoft.Azure.Management.ApplicationInsights.dll</HintPath>
5555
<Private>True</Private>
5656
</Reference>
57-
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
57+
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
5858
</ItemGroup>
5959
<ItemGroup>
6060
<Compile Include="ApplicationInsights\GetApplicationInsightsApiKey.cs" />
@@ -96,6 +96,9 @@
9696
<None Include="packages.config">
9797
<SubType>Designer</SubType>
9898
</None>
99+
<None Include="StartupScripts\*.ps1">
100+
<!-- <CopyToOutputDirectory>Always</CopyToOutputDirectory> -->
101+
</None>
99102
</ItemGroup>
100103
<ItemGroup>
101104
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#Placeholder for future scripts: Please delete this file and uncomment <CopyToOutputDirectory>Always</CopytoOutputDirectory> within the <None Include="StartupScripts\*.ps1"> block in the .csproj file.

0 commit comments

Comments
 (0)