< Back

Write-GcsBucketWebsite

Mon Jan 13, 2020 11:57 pm

NAME Write-GcsBucketWebsite



SYNOPSIS

Updates the website associated with a Cloud Storage Bucket.





SYNTAX

Write-GcsBucketWebsite [-Name] <string> [[-MainPageSuffix] <string>] [[-NotFoundPage] <string>]

[<CommonParameters>]





DESCRIPTION

Updates the website associated with a Cloud Storage Bucket.





PARAMETERS

-Name <string>

The name of the bucket to configure. This parameter will also accept a Bucket object.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-MainPageSuffix <string>

Storage object for the "main page" of the website, e.g. what is served from "http://example.com/". Defaults to

"index.html".



Required? false

Position? 1

Default value index.html

Accept pipeline input? false

Accept wildcard characters? false



-NotFoundPage <string>

Storage object to render when no appropriate file is found, e.g. what is served from

"http://example.com/sadjkffasugmd". Defaults to "404.html".



Required? false

Position? 2

Default value 404.html

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Google.Apis.Storage.v1.Data.Bucket





---------- EXAMPLE 1 ----------



Write-GcsBucketWebsite $bucket -MainPageSuffix "main.html" -NotFoundPage "error.html"



Host http://example.com from the contents of $bucket.



Next, set the domains DNS records to point to Cloud Storage. See the "Static WebsiteHosting" help topic for more

information.



RELATED LINKS

[Static Website Hosting] (https://cloud.google.com/storage/docs/h ... ic-website)

[Static Website Troubleshooting] (https://cloud.google.com/storage/docs/static-website)