diff --git a/tools/Repo-Tasks.psd1 b/tools/Repo-Tasks.psd1 index 1a9d668e1649..4216f44a2935 100644 --- a/tools/Repo-Tasks.psd1 +++ b/tools/Repo-Tasks.psd1 @@ -3,13 +3,13 @@ # # Generated by: shahabhijeet # -# Generated on: 11/2/2016 +# Generated on: 3/11/2017 # @{ # Script module or binary module file associated with this manifest. -RootModule = 'Repo-Tasks.psm1' +RootModule = '.\Repo-Tasks.psm1' # Version number of this module. ModuleVersion = '1.0' @@ -30,10 +30,10 @@ CompanyName = 'Microsoft' Copyright = '(c) 2016 shahabhijeet. All rights reserved.' # Description of the functionality provided by this module -# Description = 'Provides set of cmdlets for common repository tasks' +# Description = '' # Minimum version of the Windows PowerShell engine required by this module -# PowerShellVersion = '5.1' +PowerShellVersion = '5.1' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' @@ -42,13 +42,13 @@ Copyright = '(c) 2016 shahabhijeet. All rights reserved.' # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# DotNetFrameworkVersion = '4.5' +# DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# CLRVersion = '4.0' +# CLRVersion = '' # Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = 'x86, Amd64' +# ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() diff --git a/tools/Repo-Tasks.psm1 b/tools/Repo-Tasks.psm1 index 51dc8ffd2c4e..edc69d039264 100644 --- a/tools/Repo-Tasks.psm1 +++ b/tools/Repo-Tasks.psm1 @@ -14,7 +14,7 @@ In order to successfully run a test, you will need SubscriptionId, TenantId This cmdlet will only prompt you for Subscription and Tenant information, rest all other parameters are optional #> - [CmdletBinding(DefaultParameterSetName='UserIdParamSet')] + [CmdletBinding(DefaultParameterSetName='SpnParamSet')] param( [Parameter(ParameterSetName='UserIdParamSet', Mandatory=$true, HelpMessage = "UserId (OrgId) you would like to use")] [ValidateNotNullOrEmpty()] @@ -44,11 +44,23 @@ This cmdlet will only prompt you for Subscription and Tenant information, rest a [ValidateSet("Playback", "Record", "None")] [string]$RecordMode='Playback', - [ValidateSet("Prod", "Dogfood", "Current", "Next")] - [string]$TargetEnvironment='Prod' + [ValidateSet("Prod", "Dogfood", "Current", "Next", "Custom")] + [string]$TargetEnvironment='Prod', + + [string]$ResourceManagementUri, + [string]$GraphUri, + [string]$AADAuthUri, + [string]$AADTokenAudienceUri, + [string]$GraphTokenAudienceUri, + [string]$IbizaPortalUri, + [string]$ServiceManagementUri, + [string]$RdfePortalUri, + [string]$GalleryUri, + [string]$DataLakeStoreServiceUri, + [string]$DataLakeAnalyticsJobAndCatalogServiceUri ) - [string]$uris="https://management.azure.com/" + [string]$uris="" $formattedConnStr = [string]::Format("SubscriptionId={0};HttpRecorderMode={1};Environment={2}", $SubscriptionId, $RecordMode, $TargetEnvironment) @@ -76,11 +88,69 @@ This cmdlet will only prompt you for Subscription and Tenant information, rest a { $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";ServicePrincipalSecret={0}"), $ServicePrincipalSecret) } + + #Uris + if([string]::IsNullOrEmpty($ResourceManagementUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";ResourceManagementUri={0}"), $ResourceManagementUri) + } + + if([string]::IsNullOrEmpty($GraphUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";GraphUri={0}"), $GraphUri) + } + + if([string]::IsNullOrEmpty($AADAuthUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";AADAuthUri={0}"), $AADAuthUri) + } + + if([string]::IsNullOrEmpty($AADTokenAudienceUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";AADTokenAudienceUri={0}"), $AADTokenAudienceUri) + } + + if([string]::IsNullOrEmpty($GraphTokenAudienceUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";GraphTokenAudienceUri={0}"), $GraphTokenAudienceUri) + } + + if([string]::IsNullOrEmpty($IbizaPortalUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";IbizaPortalUri={0}"), $IbizaPortalUri) + } + + if([string]::IsNullOrEmpty($ServiceManagementUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";ServiceManagementUri={0}"), $ServiceManagementUri) + } + + if([string]::IsNullOrEmpty($RdfePortalUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";RdfePortalUri={0}"), $RdfePortalUri) + } + + if([string]::IsNullOrEmpty($GalleryUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";GalleryUri={0}"), $GalleryUri) + } + + if([string]::IsNullOrEmpty($DataLakeStoreServiceUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";DataLakeStoreServiceUri={0}"), $DataLakeStoreServiceUri) + } + + if([string]::IsNullOrEmpty($DataLakeAnalyticsJobAndCatalogServiceUri) -eq $false) + { + $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";DataLakeAnalyticsJobAndCatalogServiceUri={0}"), $DataLakeAnalyticsJobAndCatalogServiceUri) + } + - $formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";BaseUri={0}"), $uris) + #$formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";BaseUri={0}"), $uris) Write-Host "Below connection string is ready to be set" - Print-ConnectionString $UserId $Password $SubscriptionId $TenantId $ServicePrincipal $ServicePrincipalSecret $RecordMode $TargetEnvironment $uris + #Print-ConnectionString $UserId $Password $SubscriptionId $TenantId $ServicePrincipal $ServicePrincipalSecret $RecordMode $TargetEnvironment $uris + Print-ConnectionString $UserId $Password $SubscriptionId $TenantId $ServicePrincipal $ServicePrincipalSecret $RecordMode $TargetEnvironment $uris $ResourceManagementUri $GraphUri $AADAuthUri $AADTokenAudienceUri $GraphTokenAudienceUri $IbizaPortalUri $ServiceManagementUri $RdfePortalUri $GalleryUri $DataLakeStoreServiceUri $DataLakeAnalyticsJobAndCatalogServiceUri #Set connection string to Environment variable $env:TEST_CSM_ORGID_AUTHENTICATION=$formattedConnStr @@ -149,11 +219,66 @@ Function Print-ConnectionString([string]$uid, [string]$pwd, [string]$subId, [str Write-Host "Environment=" -ForegroundColor Green -NoNewline Write-Host $targetEnvironment";" -NoNewline } + + #======================================== + if([string]::IsNullOrEmpty($ResourceManagementUri) -eq $false) + { + Write-Host "ResourceManagementUri=" -ForegroundColor Green -NoNewline + Write-Host $ResourceManagementUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($GraphUri) -eq $false) + { + Write-Host "GraphUri=" -ForegroundColor Green -NoNewline + Write-Host $GraphUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($AADTokenAudienceUri) -eq $false) + { + Write-Host "AADTokenAudienceUri=" -ForegroundColor Green -NoNewline + Write-Host $AADTokenAudienceUri";" -NoNewline + } - if([string]::IsNullOrEmpty($uris) -eq $false) + if([string]::IsNullOrEmpty($GraphTokenAudienceUri) -eq $false) + { + Write-Host "GraphTokenAudienceUri=" -ForegroundColor Green -NoNewline + Write-Host $GraphTokenAudienceUri -NoNewline + } + + if([string]::IsNullOrEmpty($IbizaPortalUri) -eq $false) + { + Write-Host "IbizaPortalUri=" -ForegroundColor Green -NoNewline + Write-Host $IbizaPortalUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($ServiceManagementUri) -eq $false) + { + Write-Host "ServiceManagementUri=" -ForegroundColor Green -NoNewline + Write-Host $ServiceManagementUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($RdfePortalUri) -eq $false) + { + Write-Host "RdfePortalUri=" -ForegroundColor Green -NoNewline + Write-Host $RdfePortalUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($GalleryUri) -eq $false) + { + Write-Host "GalleryUri=" -ForegroundColor Green -NoNewline + Write-Host $GalleryUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($DataLakeStoreServiceUri) -eq $false) + { + Write-Host "DataLakeStoreServiceUri=" -ForegroundColor Green -NoNewline + Write-Host $DataLakeStoreServiceUri";" -NoNewline + } + + if([string]::IsNullOrEmpty($DataLakeAnalyticsJobAndCatalogServiceUri) -eq $false) { - Write-Host "BaseUri=" -ForegroundColor Green -NoNewline - Write-Host $uris -NoNewline + Write-Host "DataLakeAnalyticsJobAndCatalogServiceUri=" -ForegroundColor Green -NoNewline + Write-Host $DataLakeAnalyticsJobAndCatalogServiceUri";" -NoNewline } Write-Host ""