Skip to content

Is there an example of code which successfully gets and updates a cloudfront distribution? #285

Answered by ojintoad
ojintoad asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to get code like this to run - is this actually what is expected of those calling these cmdlets?

Edit: The answer seems to be yes if #214 is to be believed that this plagues other such cmdlets. Accepting my own answer.

$distribution = Get-CFDistribution -Id $distributionFromList.Id

$etag = $AWSHistory.LastServiceResponse.ETag

$params = @{
    Id = $distribution.Id
    Verbose = $true
    IfMatch = $etag
    Aliases_Item = $distribution.DistributionConfig.Aliases.Items
    Aliases_Quantity = $distribution.DistributionConfig.Aliases.Quantity
    AllowedMethods_Item = $distribution.DistributionConfig.DefaultCacheBehavior.AllowedMethods.Items
    AllowedMethods_Quantity = $distrib…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ashishdhingra
Comment options

Answer selected by ashishdhingra
Comment options

You must be logged in to vote
1 reply
@ojintoad
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
guidance Question that needs advice or information. module/powershell-cmdlets
4 participants