18
18
[Parameter (Mandatory = $false , Position = 1 )]
19
19
[string ] $apiKey ,
20
20
[Parameter (Mandatory = $false , Position = 2 )]
21
- [string ] $repositoryLocation
21
+ [string ] $repository
22
22
)
23
23
24
24
if ([string ]::IsNullOrEmpty($buildConfig ))
@@ -29,18 +29,32 @@ if ([string]::IsNullOrEmpty($buildConfig))
29
29
30
30
if ([string ]::IsNullOrEmpty($repositoryLocation ))
31
31
{
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'
34
35
}
35
36
37
+ $repositoryLocation = ' $repository/api/v2/'
38
+ $repositoryPackageLocation = ' $repository/api/v2/package'
39
+
40
+
36
41
$packageFolder = " $PSScriptRoot \..\src\Package"
37
42
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
+ }
40
50
$modulePath = " $packageFolder \$buildConfig \ServiceManagement\Azure"
41
51
# Publish Azure module
42
52
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" )
44
58
Write-Host " Published Azure module"
45
59
# Publish AzureRM.Profile module
46
60
Write-Host " Publishing AzureRM.Profile module from $modulePath "
@@ -53,8 +67,7 @@ foreach ($module in $resourceManagerModules) {
53
67
if ($module -ne " AzureRM.Profile" ) {
54
68
$modulePath = $module.FullName
55
69
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 " )
57
71
Write-Host " Published $module module"
58
72
}
59
- }
60
- Unregister-PSRepository - Name $repoName
73
+ }
0 commit comments