File tree Expand file tree Collapse file tree 5 files changed +66
-11
lines changed
setup-powershellget/Setup Expand file tree Collapse file tree 5 files changed +66
-11
lines changed Original file line number Diff line number Diff line change 36
36
<SetupOutputDirectory >$(PublishDirectory)\Setup</SetupOutputDirectory >
37
37
<TestOutputDirectory >$(PublishDirectory)\TestResults</TestOutputDirectory >
38
38
<BuildInParallel Condition =" '$(BuildInParallel)' == ''" >true</BuildInParallel >
39
+ <NuGetPublishingSource Condition =" '$(NuGetPublishingSource)' != '' " >http://psget/PSGallery/api/v2/</NuGetPublishingSource >
39
40
</PropertyGroup >
40
41
<ItemGroup >
41
42
<AzureResourceManagerSln Include =" .\src\ResourceManager.sln" />
115
116
<NuGetCommand >$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand >
116
117
<NuGetRestoreConfigFile >$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile >
117
118
<NuGetRestoreConfigSwitch >-ConfigFile " $(NuGetRestoreConfigFile)" </NuGetRestoreConfigSwitch >
119
+ <PowerShellCommand >C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand >
118
120
</PropertyGroup >
119
121
120
122
<!--
285
287
<!-- If we are testing locally then we copy the binaries and do not submit to the code sign server-->
286
288
<Copy SourceFiles =" @(InstallersToSign)" DestinationFolder =" signed" Condition =" $(DelaySign)" />
287
289
</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 " . $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(NuGetKey) \" $(NuGetPublishingSource)\"" " />
297
+ </Target >
288
298
289
299
<PropertyGroup >
290
300
<RunTestLive Condition =" '$(RunTestLive)' == ''" >false</RunTestLive >
Original file line number Diff line number Diff line change @@ -26,9 +26,15 @@ Finalizing installation of Azure PowerShell.
26
26
Installing Azure Modules from PowerShell Gallery.
27
27
This may take some time...
28
28
"@
29
+ Import-Module PackageManagement
29
30
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
+ }
32
38
} else {
33
39
cd c:\
34
40
$welcomeMessage = @"
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -34,15 +34,6 @@ if ([string]::IsNullOrEmpty($repositoryLocation))
34
34
}
35
35
36
36
$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"
46
37
47
38
$repoName = $ (New-Guid ).ToString()
48
39
Register-PSRepository - Name $repoName - SourceLocation $repositoryLocation - PublishLocation $repositoryLocation - InstallationPolicy Trusted
You can’t perform that action at this time.
0 commit comments