Skip to content

Commit a227052

Browse files
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into dev
Conflicts: src/ResourceManager/Common/Commands.ResourceManager.Common/RMProfileClient.cs
2 parents 113cfc7 + cbd9c6d commit a227052

File tree

155 files changed

+31774
-4403
lines changed

Some content is hidden

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

155 files changed

+31774
-4403
lines changed

AzurePowershell.Test.targets

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
5151
ContinueOnError="false" />
5252
</Target>
53-
54-
<Target Name="InvokeXUnit">
53+
54+
<Target Name="DeclareXunitTests">
5555
<ItemGroup>
5656
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
5757
<AsmXUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
@@ -62,7 +62,7 @@
6262
<AsmXUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
6363
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
6464
</ItemGroup>
65-
<ItemGroup Condition=" '$(scope)' == '' ">
65+
<ItemGroup Condition=" '$(scope)' == 'all' ">
6666
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
6767
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
6868
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
@@ -85,10 +85,12 @@
8585
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
8686
<XUnitTests Include="@(AsmXUnitTests)"/>
8787
</ItemGroup>
88-
<ItemGroup Condition=" '$(scope)' !='' and '$(scope)' != 'ServiceManagement' ">
88+
<ItemGroup Condition=" '$(scope)' != 'all' and '$(scope)' != 'ServiceManagement' and '$(scope)' != 'AzureStorage' ">
8989
<XUnitTests Include="$(MSBuildProjectDirectory)\src\ResourceManager\$(scope)\*\bin\Debug\*.Test.dll"/>
9090
</ItemGroup>
91-
91+
</Target>
92+
93+
<Target Name="InvokeXUnit" DependsOnTargets="DeclareXunitTests">
9294
<Message Importance="high" Text="Running XUnit tests" />
9395
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
9496
<Exec
@@ -97,7 +99,7 @@
9799
<OnError ExecuteTargets="TimeoutErrorHandler"/>
98100
</Target>
99101

100-
<Target Name="InvokeXUnitAll">
102+
<Target Name="InvokeXUnitAll" DependsOnTargets="DeclareXunitTests">
101103
<Message Importance="high" Text="Running XUnit tests" />
102104
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
103105
<Exec

build.proj

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
1919
/p:CodeSign=True;DelaySign=True
2020
Test the code sign workflow locally.
21-
21+
22+
/p:Scope
23+
'ServiceManagement': service management
24+
'AzureStorage': storage data plane cmdlets
25+
'Subfolder under src\ResourceManager': An individual cmdlet module
26+
By default, it builds all
2227
-->
2328

2429
<!-- Define build properties -->
@@ -37,11 +42,14 @@
3742
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
3843
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
3944
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
45+
<Scope Condition=" $(Scope) == '' " >all</Scope>
4046
</PropertyGroup>
4147
<ItemGroup>
42-
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
43-
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" Condition=" '$(Scope)' != '' and '$(Scope)' != 'ServiceManagement' "/>
44-
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' != '' and '$(Scope)' == 'ServiceManagement' "/>
48+
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == 'all' "/>
49+
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln"
50+
Condition=" '$(Scope)' != 'all' and '$(Scope)' != 'ServiceManagement' and '$(Scope)' != 'AzureStorage' "/>
51+
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
52+
Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/>
4553
<SetupSln Include=".\setup\azurepowershell.sln" />
4654
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
4755
</ItemGroup>
@@ -77,7 +85,7 @@
7785
Targets="Clean"
7886
Properties="Configuration=$(Configuration);Platform=Any CPU"
7987
ContinueOnError="false"
80-
Condition=" '$(Scope)' == '' "/>
88+
Condition=" '$(Scope)' == 'all' "/>
8189

8290
<!-- Delete the publish files -->
8391
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
@@ -159,17 +167,17 @@
159167
Targets="Build"
160168
Properties="Configuration=$(Configuration);Platform=Any CPU"
161169
ContinueOnError="false"
162-
Condition=" '$(Scope)' == '' "/>
170+
Condition=" '$(Scope)' == 'all' "/>
163171

164172
<MSBuild
165173
Projects="@(SetupSln)"
166174
Targets="Build"
167175
Properties="Configuration=$(Configuration);Platform=Any CPU"
168176
ContinueOnError="false"
169-
Condition=" '$(Scope)' == '' "/>
177+
Condition=" '$(Scope)' == 'all' "/>
170178

171179
<CallTarget Targets="CodeSignInstaller"
172-
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == ''" />
180+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
173181
</Target>
174182

175183
<!-- Do everything possible -->
@@ -289,11 +297,10 @@
289297
</Target>
290298

291299
<!-- Publish all packages -->
292-
<Target Name="Publish" DependsOnTargets="Build">
300+
<Target Name="Publish">
293301
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
294302
<Message Importance="high" Text="Publishing Cmdlets..." />
295-
296-
<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
303+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
297304
</Target>
298305

299306
<PropertyGroup>

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,25 @@ Param(
1717
[switch]$Install
1818
)
1919

20+
function EnsureRegistryPath
21+
{
22+
$originalpaths = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PSModulePath).PSModulePath
23+
if($originalpaths.Contains("$env:ProgramFiles\WindowsPowerShell\Modules") -eq $false)
24+
{
25+
Write-Output "Fixing PSModulePath"
26+
$newPath = "$originalpaths;$env:ProgramFiles\WindowsPowerShell\Modules"
27+
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PSModulePath –Value $newPath
28+
}
29+
else
30+
{
31+
Write-Output "PSModulePath successfuly validated"
32+
}
33+
}
34+
2035
$error.clear()
2136
try {
2237
if ($Install.IsPresent) {
38+
EnsureRegistryPath
2339
Write-Output @"
2440
2541
Finalizing installation of Azure PowerShell.
@@ -57,4 +73,5 @@ Write-Output "An error occured during installation."
5773
Write-Output $error
5874
Write-Output "Press any key..."
5975
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
60-
}
76+
}
77+

0 commit comments

Comments
 (0)