HI Peoples. PSCustomObject question :)

Hello all,

 

Trying to do a compare for an automation job. Need to compare:

I need to if (get-azureelasticpoo$Checkvalue) does not equal what it was supposed to set to- (set-azureelasticpool -Dtu $ConfigurationInformation.DTUDay[$i] )

Then I send an email. I can send the email fine- this is just to catch the RANDOM THAT MS CAN’T EXPLAIN failures where it does not change Elastic Pool Size on 1 out of 10 pools- like once every couple weeks.

$checkValues= (Get-AzSqlElasticPool -ResourceGroupName $ConfigurationInformation.ResourceGroupName[8] -ServerName $ConfigurationInformation.ServerName[8] -ElasticPoolName $ConfigurationInformation.ElasticPoolName[8] | Select-Object  Dtu) #-join ";"#Dtu, DatabaseDtuMax)#Write-Output $checkValues

Against the DTU’s that have been set from this this earlier. Making sure a change took place.

Set-AzSqlElasticPool -ResourceGroupName $ConfigurationInformation.ResourceGroupName[$i] -ServerName $ConfigurationInformation.ServerName[$i] -ElasticPoolName $ConfigurationInformation.ElasticPoolName[$i] -Dtu $ConfigurationInformation.DTUDay[$i] -DatabaseDtuMax $ConfigurationInformation.DBDTUDAYMax[$i]

Read the pinned thread on how to post code in the forum and fix your post. The only thing that is catching my eye is the parameter for the check is hard-coded to 8:

-ResourceGroupName $ConfigurationInformation.ResourceGroupName[8]

vs the set which is using a $i token in a for loop I assume:

-ResourceGroupName $ConfigurationInformation.ResourceGroupName[$i] 

All servers would check against the server at index 8 vs telling what the settings are for the current server with $1.