@@ -799,6 +799,39 @@ $IPPoolBodyJson =$IPPoolBody |ConvertTo-Json
799799}
800800export-modulemember - function Add-AzSIPPool
801801
802+ Function Set-AzSLocationInformation {
803+ Param (
804+ [Parameter (Mandatory = $true )]
805+ [ValidateNotNullorEmpty ()]
806+ [String ] $TenantId ,
807+
808+ [Parameter (Mandatory = $true )]
809+ [System.Management.Automation.PSCredential ] $AzureStackCredentials ,
810+
811+ [Parameter (Mandatory = $true )]
812+ [string ] $EnvironmentName ,
813+
814+ [Parameter (Mandatory = $true )]
815+ [string ] $Region = ' local' ,
816+
817+ [Parameter (Mandatory = $true )]
818+ [string ] $Latitude = ' 47.608013' ,
819+
820+ [Parameter (Mandatory = $true )]
821+ [string ] $Longitude = ' -122.335167'
822+ )
823+ $ArmEndpoint = GetARMEndpoint - EnvironmentName $EnvironmentName - ErrorAction Stop
824+ $subscription , $headers = (Get-AzureStackAdminSubTokenHeader - TenantId $TenantId - AzureStackCredentials $AzureStackCredentials - EnvironmentName $EnvironmentName )
825+ $uri = " {0}/subscriptions/{1}/providers/Microsoft.Subscriptions.Admin/locations/{2}?api-version=2015-11-01" -f $ArmEndpoint , $subscription , $Region
826+
827+ $obtainedRegion = Invoke-RestMethod - Method GET - Uri $uri - ContentType ' application/json' - Headers $headers
828+ $obtainedRegion.latitude = $Latitude
829+ $obtainedRegion.longitude = $Longitude
830+
831+ Invoke-WebRequest - Uri $uri - Method PUT - Body $ (Convertto-Json $obtainedRegion ) - ContentType ' application/json' - Headers $headers
832+ }
833+ Export-ModuleMember - function Set-AzSLocationInformation
834+
802835Function GetARMEndpoint {
803836 param (
804837 # Azure Stack environment name
@@ -816,4 +849,4 @@ Function GetARMEndpoint{
816849 }
817850
818851 $ARMEndpoint
819- }
852+ }
0 commit comments