Skip to content

Commit 9799223

Browse files
committed
Merge pull request #106 from Azure/dev
.
2 parents e30bb97 + 2cc2e63 commit 9799223

File tree

5 files changed

+66
-11
lines changed

5 files changed

+66
-11
lines changed

build.proj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
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>
4142
<AzureResourceManagerSln Include=".\src\ResourceManager.sln" />
@@ -115,6 +116,7 @@
115116
<NuGetCommand>$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand>
116117
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
117118
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
119+
<PowerShellCommand>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
118120
</PropertyGroup>
119121

120122
<!--
@@ -285,6 +287,14 @@
285287
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
286288
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" />
287289
</Target>
290+
291+
<!-- Publish all packages -->
292+
<Target Name="Publish" DependsOnTargets="Build">
293+
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
294+
<Message Importance="high" Text="Publishing Cmdlets..." />
295+
296+
<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot;&quot;"/>
297+
</Target>
288298

289299
<PropertyGroup>
290300
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ Finalizing installation of Azure PowerShell.
2626
Installing Azure Modules from PowerShell Gallery.
2727
This may take some time...
2828
"@
29+
Import-Module PackageManagement
2930
Get-PackageProvider -Name NuGet -ForceBootstrap
30-
Install-Module AzureRM.Installer
31-
Install-AzureRM
31+
32+
$NuGetPublishingSource = $env:NuGetPublishingSource
33+
if ([string]::IsNullOrWhiteSpace($NuGetPublishingSource)) {
34+
Install-Module AzureRM -Repository $NuGetPublishingSource
35+
} else {
36+
Install-Module AzureRM
37+
}
3238
} else {
3339
cd c:\
3440
$welcomeMessage = @"

tools/AzureRM/AzureRM.psd1

5.14 KB
Binary file not shown.

tools/AzureRM/AzureRM.psm1

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<#
2+
.Synopsis
3+
Install Azure Resource Manager cmdlet modules
4+
5+
.Description
6+
Installs all the available Azure Resource Manager cmdlet modules that start with "AzureRM".
7+
8+
.Parameter Repository
9+
Limit the search for "AzureRM" cmdlets in a specific repository.
10+
11+
.Parameter Scope
12+
Specifies the parameter scope.
13+
#>
14+
function Update-AzureRM
15+
{
16+
param(
17+
[Parameter(Position=0, Mandatory = $false)]
18+
[string]
19+
$Repository,
20+
21+
[Parameter(Position=1, Mandatory = $false)]
22+
[ValidateSet("CurrentUser","AllUsers")]
23+
[string]
24+
$Scope)
25+
26+
if ([string]::IsNullOrWhiteSpace($Scope))
27+
{
28+
$Scope = "AllUsers"
29+
}
30+
31+
Install-Module AzureRM.Profile -Repository $Repository
32+
if ([string]::IsNullOrWhiteSpace($Repository))
33+
{
34+
$modules = Find-Module -Name AzureRM.* | Where-Object {$_.Name -ne "AzureRM" -and $_.Name -ne "AzureRM.Profile"}
35+
} else {
36+
$modules = Find-Module -Repository $Repository | Where-Object {$_.Name -like "AzureRM.*" -and $_.Name -ne "AzureRM" -and $_.Name -ne "AzureRM.Profile"}
37+
}
38+
39+
Write-Output "Installing $($modules.Length) AzureRM modules. This may take a few minutes."
40+
41+
$result = $modules | ForEach {
42+
Start-Job -Name $_.Name -ScriptBlock {
43+
Install-Module -Name $args[0] -Repository $args[1] -Scope $args[2]
44+
Write-Output "$($args[0]) installed..."
45+
} -ArgumentList $_.Name, $Repository, $Scope }
46+
47+
$modules | ForEach {Get-Job -Name $_.Name | Wait-Job | Receive-Job }
48+
}

tools/PublishModules.ps1

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ if ([string]::IsNullOrEmpty($repositoryLocation))
3434
}
3535

3636
$packageFolder = "$PSScriptRoot\..\src\Package"
37-
$scriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
38-
. ($scriptFolder + '.\SetupEnv.ps1')
39-
40-
if (Test-Path $packageFolder) {
41-
Remove-Item -Path $packageFolder -Recurse -Force
42-
}
43-
44-
# Build the cmdlets in debug mode
45-
msbuild "$env:AzurePSRoot\build.proj" /t:"BuildDebug"
4637

4738
$repoName = $(New-Guid).ToString()
4839
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation -InstallationPolicy Trusted

0 commit comments

Comments
 (0)