I am trying to update my CloudFront distribution using AWSPowerShell module for PowerShell. When I use the update cmdlet from the module, I always get an error about not providing the "IfMatch" parameter.
$cfd = Update-CFDistribution @parameters -Id "E2POBWR9AXFROP"
Error: The If-Match version is missing or not valid for the resource.
Update-CFDistribution : The If-Match version is missing or not valid for the resource.
I went to the AWS doc to know about this parameter and it says:
-IfMatch: The value of the ETag header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL.
I was wondering if there is a way to to get the content of the ETag header using the AWSPowerShell module cmdlets. I don't want to call directly the AWS API doing an Http request in my PowerShell script just to get the content of the header... but maybe it's the only way.
I tried with the Get-CFDistributionConfig cmdlet but it doesn't return this information.
$cfd = Get-CFDistributionConfig @parameters -Id "E2POBWR9AXFROP"
This is the version of PowerShell I am using:
PS C:\> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 15063 608
This is the version of AWSPowerShell module I am using:
PS C:\> Get-Module "AWSPowerShell" -ListAvailable
ModuleType Version Name
---------- ------- ----
Binary 3.3.169.0 AWSPowerShell