update
This commit is contained in:
+11
-10
@@ -82,6 +82,8 @@ switch ($PSCmdlet.ParameterSetName) {
|
||||
|
||||
$FqdnFromSCTaskDescription = ($SCTask.short_description).display_value.split(' ')[7]
|
||||
|
||||
$AvailabilityZone =
|
||||
|
||||
$NewITDWindowsVmAzureParams = @{
|
||||
FQDN = ( ($Ritm.VariableSet | Where-Object { $_.host_name -eq $FqdnFromSCTaskDescription }).host_name );
|
||||
VmSize = ( ($Ritm.VariableSet | Where-Object { $_.host_name -eq $FqdnFromSCTaskDescription }).azure_vm_size );
|
||||
@@ -92,24 +94,23 @@ switch ($PSCmdlet.ParameterSetName) {
|
||||
VMEnvironment = ( $Ritm.customvariable.environment.value );
|
||||
AppName = ( Get-ITDServiceNowRecord -Table 'cmdb_ci_service' -SysId ($Ritm.VariableSet | Where-Object { $_.host_name -eq "$FqdnFromSCTaskDescription" }).application_info).name.display_value;
|
||||
LicensingRestrictions = ( ($Ritm.VariableSet | Where-Object { $_.host_name -eq $FqdnFromSCTaskDescription }).licensing_restrictions );
|
||||
AvailabilityZone = ( switch( ($Ritm.VariableSet | Where-Object { $_.host_name -eq $FqdnFromSCTaskDescription }).zone ) {
|
||||
'1' { 'Zone 1' }
|
||||
'2' { 'Zone 2' }
|
||||
'3' { 'Zone 3' }
|
||||
Default { 'No Zone' }
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
switch ( ($Ritm.VariableSet | Where-Object { $_.host_name -eq $FqdnFromSCTaskDescription }).zone ) {
|
||||
'Zone 1' { $NewITDWindowsVMAzureParams += @{ AvailabilityZone = 1 } }
|
||||
'Zone 2' { $NewITDWindowsVMAzureParams += @{ AvailabilityZone = 2 } }
|
||||
'Zone 3' { $NewITDWindowsVMAzureParams += @{ AvailabilityZone = 3 } }
|
||||
}
|
||||
|
||||
switch ($PSBoundParameters.Keys) {
|
||||
'ResourceGroupNameOverride' {
|
||||
Write-Warning -Message "ResourceGroupNameOverride found $ResourceGroupNameOverride"
|
||||
$NewITDWindowsVMAzureParams += @{ ResourceGroupNameOverride = $ResourceGroupNameOverride }
|
||||
}
|
||||
'AvailabilityZone' {
|
||||
<#'AvailabilityZone' {
|
||||
Write-Warning -Message "ResourceGroupNameOverride found $AvailabilityZone"
|
||||
$NewITDWindowsVMAzureParams += @{ AvailabilityZone = $AvailabilityZone }
|
||||
}
|
||||
}#>
|
||||
<# 'VMSizeOverride' {
|
||||
Write-Warning -Message "VMSizeOverride found $VMSizeOverride"
|
||||
$NewITDWindowsVMAzureParams += @{ VMSizeOverride = $VMSizeOverride }
|
||||
|
||||
Reference in New Issue
Block a user