Skip to content

Commit 0b8cd85

Browse files
committed
Merge pull request Azure#40 from huangpf/vmss
VMSS
2 parents de826cb + 83437a6 commit 0b8cd85

File tree

1,017 files changed

+35271
-32630
lines changed

Some content is hidden

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

1,017 files changed

+35271
-32630
lines changed

AzurePowershell.Test.targets

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,7 @@
4242
<TestTimeout Condition=" '$(TestTimeout)' == '' ">100000000</TestTimeout>
4343
</PropertyGroup>
4444

45-
<ItemGroup>
46-
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
47-
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
48-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
49-
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
50-
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
51-
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
52-
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
53-
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
54-
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
55-
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
56-
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
57-
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
58-
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
59-
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
60-
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
61-
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
62-
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
63-
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
64-
<XUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
65-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
66-
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
67-
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
68-
<XUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
69-
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
70-
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
71-
</ItemGroup>
72-
45+
7346
<Target Name="InvokeMSTest">
7447
<!--Remove existing test result; otherwise mstest will error-->
7548
<Delete Files="$(_testResult)"/>
@@ -79,11 +52,48 @@
7952
</Target>
8053

8154
<Target Name="InvokeXUnit">
55+
<ItemGroup>
56+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
57+
<AsmXUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
58+
<AsmXUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
59+
<AsmXUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
60+
<AsmXUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
61+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
62+
<AsmXUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
63+
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
64+
</ItemGroup>
65+
<ItemGroup Condition=" '$(scope)' == '' ">
66+
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
67+
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
68+
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
69+
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
70+
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
71+
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
72+
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
73+
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
74+
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
75+
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
76+
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
77+
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
78+
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
79+
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
80+
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
81+
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
82+
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
83+
<XUnitTests Include="@(AsmXUnitTests)"/>
84+
</ItemGroup>
85+
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
86+
<XUnitTests Include="@(AsmXUnitTests)"/>
87+
</ItemGroup>
88+
<ItemGroup Condition=" '$(scope)' !='' and '$(scope)' != 'ServiceManagement' ">
89+
<XUnitTests Include="$(MSBuildProjectDirectory)\src\ResourceManager\$(scope)\*\bin\Debug\*.Test.dll"/>
90+
</ItemGroup>
91+
8292
<Message Importance="high" Text="Running XUnit tests" />
8393
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
8494
<Exec
8595
Command="$(MSBuildProjectDirectory)\packages\xunit.runner.console.2.0.0\tools\xunit.console.x86.exe &quot;%(XUnitTests.Identity)&quot; -parallel none -maxthreads 0 -trait &quot;AcceptanceType=CheckIn&quot; -html &quot;$(TestOutputDirectory)\%(XUnitTests.Filename).html&quot;"
86-
Timeout="$(TestTimeout)" ContinueOnError="false"/>
96+
Timeout="$(TestTimeout)" ContinueOnError="false" Condition=" @(XUnitTests) != '' "/>
8797
<OnError ExecuteTargets="TimeoutErrorHandler"/>
8898
</Target>
8999

@@ -101,7 +111,6 @@
101111
</Target>
102112

103113
<Target Name="BeforeRunTests">
104-
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
105114
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
106115
</Target>
107116

build.proj

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@
3636
<SetupOutputDirectory>$(PublishDirectory)\Setup</SetupOutputDirectory>
3737
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
3838
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
39+
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' != '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
3940
</PropertyGroup>
4041
<ItemGroup>
41-
<AzureResourceManagerSln Include=".\src\ResourceManager.sln" />
42-
<AzureServiceManagementSln Include=".\src\ServiceManagement.sln" />
42+
<CmdletSolutionsToBuild Include=".\src\ResourceManager.sln;.\src\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
43+
<CmdletSolutionsToBuild Include=".\src\$(Scope).sln" Condition=" '$(Scope)' != '' "/>
4344
<SetupSln Include=".\setup\azurepowershell.sln" />
4445
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
4546
</ItemGroup>
@@ -63,28 +64,19 @@
6364

6465
<!-- Clean the build in all configurations -->
6566
<Target Name="Clean">
66-
<!-- Clean the solutions -->
6767
<Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
6868
<MSBuild
69-
Projects="@(AzureResourceManagerSln)"
70-
Targets="Clean"
71-
Properties="Configuration=$(Configuration);Platform=Any CPU"
72-
ContinueOnError="false" />
73-
<MSBuild
74-
Projects="@(AzureServiceManagementSln)"
75-
Targets="Clean"
76-
Properties="Configuration=$(Configuration);Platform=Any CPU"
77-
ContinueOnError="false" />
78-
<MSBuild
79-
Projects="@(SetupSln)"
69+
Projects="@(CmdletSolutionsToBuild)"
8070
Targets="Clean"
8171
Properties="Configuration=$(Configuration);Platform=Any CPU"
8272
ContinueOnError="false" />
73+
8374
<MSBuild
8475
Projects="@(SetupPowershellGetSln)"
8576
Targets="Clean"
8677
Properties="Configuration=$(Configuration);Platform=Any CPU"
87-
ContinueOnError="false" />
78+
ContinueOnError="false"
79+
Condition=" '$(Scope)' == '' "/>
8880

8981
<!-- Delete the publish files -->
9082
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
@@ -115,6 +107,7 @@
115107
<NuGetCommand>$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand>
116108
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
117109
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
110+
<PowerShellCommand>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
118111
</PropertyGroup>
119112

120113
<!--
@@ -138,8 +131,12 @@
138131
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(MSBuildProjectDirectory)\tools\LocalFeed&quot; $(NuGetRestoreConfigSwitch)"/>
139132

140133
<!-- Restore packages -->
141-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ResourceManager.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
142-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ServiceManagement.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
134+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ResourceManager.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
135+
Condition="$(Scope) == ''" />
136+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ServiceManagement.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
137+
Condition="$(Scope) == ''" />
138+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\$(Scope).sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
139+
Condition="$(Scope) != ''" />
143140

144141
<!--Restore the xunit runner needed to run unit tests-->
145142
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
@@ -151,15 +148,11 @@
151148
<Target Name="Build" DependsOnTargets="RestoreNugetPackages;BuildMsBuildTask">
152149
<Message Importance="high" Text="Building Cmdlets..." />
153150
<MSBuild
154-
Projects="@(AzureResourceManagerSln)"
151+
Projects="@(CmdletSolutionsToBuild)"
155152
Targets="Build"
156153
Properties="Configuration=$(Configuration);Platform=Any CPU"
157-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
158-
<MSBuild
159-
Projects="@(AzureServiceManagementSln)"
160-
Targets="Build"
161-
Properties="Configuration=$(Configuration);Platform=Any CPU"
162-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
154+
BuildInParallel="$(BuildInParallel)"
155+
ContinueOnError="false" />
163156

164157
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
165158

@@ -168,14 +161,18 @@
168161
Projects="@(SetupPowershellGetSln)"
169162
Targets="Build"
170163
Properties="Configuration=$(Configuration);Platform=Any CPU"
171-
ContinueOnError="false" />
164+
ContinueOnError="false"
165+
Condition=" '$(Scope)' == '' "/>
166+
172167
<MSBuild
173168
Projects="@(SetupSln)"
174169
Targets="Build"
175170
Properties="Configuration=$(Configuration);Platform=Any CPU"
176-
ContinueOnError="false" />
171+
ContinueOnError="false"
172+
Condition=" '$(Scope)' == '' "/>
177173

178-
<CallTarget Targets="CodeSignInstaller" Condition=" '$(CodeSign)' == 'true' " />
174+
<CallTarget Targets="CodeSignInstaller"
175+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == ''" />
179176
</Target>
180177

181178
<!-- Do everything possible -->
@@ -285,6 +282,14 @@
285282
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
286283
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" />
287284
</Target>
285+
286+
<!-- Publish all packages -->
287+
<Target Name="Publish" DependsOnTargets="Build">
288+
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
289+
<Message Importance="high" Text="Publishing Cmdlets..." />
290+
291+
<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot;&quot;"/>
292+
</Target>
288293

289294
<PropertyGroup>
290295
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
@@ -295,7 +300,7 @@
295300
<Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>
296301

297302
<!-- Run checkin tests for each pull request -->
298-
<Target Name="Test" DependsOnTargets="Build;BeforeRunTests">
303+
<Target Name="Test" DependsOnTargets="BeforeRunTests">
299304
<Message Importance="high" Text="Running check in tests..." />
300305
<CallTarget Targets="InvokeXUnit"/>
301306
</Target>

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,41 @@ Param(
1717
[switch]$Install
1818
)
1919

20-
cd c:\
21-
$welcomeMessage = @"
20+
$error.clear()
21+
try {
22+
if ($Install.IsPresent) {
23+
Write-Output @"
24+
25+
Finalizing installation of Azure PowerShell.
26+
Installing Azure Modules from PowerShell Gallery.
27+
This may take some time...
28+
"@
29+
$env:PSModulePath = "$env:HOME\Documents\WindowsPowerShell\Modules;$env:ProgramFiles\WindowsPowerShell\Modules;$env:SystemRoot\system32\WindowsPowerShell\v1.0\Modules\"
30+
31+
Import-Module PackageManagement
32+
33+
$result = Get-PackageProvider -Name NuGet -ForceBootstrap
34+
35+
Import-Module PowerShellGet
36+
37+
Install-Module AzureRM
38+
Write-Output "AzureRM $((Get-InstalledModule -Name AzureRM)[0].Version) installed..."
39+
Update-AzureRM
40+
} else {
41+
cd c:\
42+
$welcomeMessage = @"
2243
For a list of all Azure cmdlets type 'help azure'.
2344
For a list of Azure Pack cmdlets type 'Get-Command *wapack*'.
45+
46+
To use Azure Service Management cmdlets please execute the following cmdlet:
47+
Install-Module Azure
2448
"@
25-
Write-Output $welcomeMessage
49+
Write-Output $welcomeMessage
2650

27-
$VerbosePreference = "Continue"
51+
$VerbosePreference = "Continue"
52+
}
53+
}
54+
catch { Write-Output $error }
55+
if ($error) {
56+
Read-Host -Prompt "An error occured during installation. Press any key..."
57+
}

setup-powershellget/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
103103
Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
104104
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;Set-ExecutionPolicy RemoteSigned -Force&quot;" Execute="deferred" Impersonate="no" Return="check"/>
105-
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;\&quot;[PowerShellFolder]\ShortcutStartup.ps1 -Install\&quot;&quot;" Execute="deferred" Impersonate="no" Return="check"/>
105+
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;. \&quot;[PowerShellFolder]\ShortcutStartup.ps1\&quot; -Install&quot;" Execute="deferred" Impersonate="no" Return="check"/>
106106

107107
<InstallExecuteSequence>
108108
<Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>

0 commit comments

Comments
 (0)