Skip to content

Commit b5af0cc

Browse files
committed
Work in progress
1 parent 2444a52 commit b5af0cc

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
</Target>
290290

291291
<!-- Publish all packages -->
292-
<Target Name="Publish" DependsOnTargets="Build">
292+
<Target Name="Publish">
293293
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
294294
<Message Importance="high" Text="Publishing Cmdlets..." />
295295

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ Finalizing installation of Azure PowerShell.
2626
Installing Azure Modules from PowerShell Gallery.
2727
This may take some time...
2828
"@
29-
Import-Module "$env:programfiles\WindowsPowerShell\Modules\PackageManagement\1.0.0.0\PackageManagement.psd1"
29+
Import-Module PackageManagement
3030

3131
$result = Get-PackageProvider -Name NuGet -ForceBootstrap
3232

33-
Import-Module "$env:programfiles\WindowsPowerShell\Modules\PowerShellGet\PowerShellGet.psd1"
33+
Import-Module PowerShellGet
3434

3535
$NuGetPublishingSource = $env:NuGetPublishingSource
3636
if ([string]::IsNullOrWhiteSpace($NuGetPublishingSource)) {

tools/PublishModules.ps1

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ param(
1818
[Parameter(Mandatory = $false, Position = 1)]
1919
[string] $apiKey,
2020
[Parameter(Mandatory = $false, Position = 2)]
21-
[string] $repositoryLocation
21+
[string] $repository
2222
)
2323

2424
if ([string]::IsNullOrEmpty($buildConfig))
@@ -29,18 +29,32 @@ if ([string]::IsNullOrEmpty($buildConfig))
2929

3030
if ([string]::IsNullOrEmpty($repositoryLocation))
3131
{
32-
Write-Verbose "Setting repository location to 'http://psget/PSGallery/api/v2/'"
33-
$repositoryLocation = 'http://psget/PSGallery/api/v2/'
32+
Write-Verbose "Setting repository location to 'https://dtlgalleryint.cloudapp.net/api/v2'"
33+
34+
$repository = 'https://dtlgalleryint.cloudapp.net'
3435
}
3536

37+
$repositoryLocation = '$repository/api/v2/'
38+
$repositoryPackageLocation = '$repository/api/v2/package'
39+
40+
3641
$packageFolder = "$PSScriptRoot\..\src\Package"
3742

38-
$repoName = $(New-Guid).ToString()
39-
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation -InstallationPolicy Trusted
43+
$repo = Get-PSRepository | where { $_.SourceLocation -eq $repositoryLocation }
44+
if ($repo -ne $null) {
45+
$repoName = $repo.Name
46+
} else {
47+
$repoName = $(New-Guid).ToString()
48+
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryPackageLocation -InstallationPolicy Trusted
49+
}
4050
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
4151
# Publish Azure module
4252
Write-Host "Publishing Azure module from $modulePath"
43-
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
53+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure", "AzureRM")
54+
# Publish AzureRM module
55+
$modulePath = "$PSScriptRoot\AzureRM"
56+
Write-Host "Publishing AzureRM module from $modulePath"
57+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure", "AzureRM")
4458
Write-Host "Published Azure module"
4559
# Publish AzureRM.Profile module
4660
Write-Host "Publishing AzureRM.Profile module from $modulePath"
@@ -53,8 +67,7 @@ foreach ($module in $resourceManagerModules) {
5367
if ($module -ne "AzureRM.Profile") {
5468
$modulePath = $module.FullName
5569
Write-Host "Publishing $module module from $modulePath"
56-
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
70+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure", "AzureRM")
5771
Write-Host "Published $module module"
5872
}
59-
}
60-
Unregister-PSRepository -Name $repoName
73+
}

0 commit comments

Comments
 (0)