< Back

Set-GcsObject

Mon Jan 13, 2020 11:53 pm

NAME Set-GcsObject



SYNOPSIS

Set-GcsObject updates metadata associated with a Cloud Storage Object.





SYNTAX

Set-GcsObject [[-Bucket] <string>] [-ObjectName] <string> [-PredefinedAcl {AuthenticatedRead |

BucketOwnerFullControl | BucketOwnerRead | Private__ | ProjectPrivate | PublicRead}] [<CommonParameters>]



Set-GcsObject [-InputObject] <Object> [-PredefinedAcl {AuthenticatedRead | BucketOwnerFullControl |

BucketOwnerRead | Private__ | ProjectPrivate | PublicRead}] [<CommonParameters>]





DESCRIPTION

Updates the metadata associated with a Cloud Storage Object, such as ACLs.



If this cmdlet is used when PowerShell is in a Google Cloud Storage Provider location (i.e, the shell's location

starts with gs:\\), then you may not need to supply -Bucket. For example, if the location is gs:\\my-bucket, the

cmdlet will automatically fill out -Bucket with "my-bucket". If -Bucket is still used, however, whatever value

given will override "my-bucket". If the location is inside a folder on Google Cloud Storage, then the cmdlet will

prefix the folder name to the object name.





PARAMETERS

-Bucket <string>

Name of the bucket to check. Will also accept a Bucket object.



Required? false

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ObjectName <string>

Name of the object to update.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InputObject <Object>

Storage object instance to update.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Object <Object>

Storage object instance to update.



This is an alias of the InputObject parameter.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-PredefinedAcl <PredefinedAclEnum>

Set the object's ACL using PredefinedAcl. "Private__" gives the object owner "OWNER" permission. All other

permissions are removed. "ProjectPrivate" gives permission to the project team based on their roles. Anyone

who is part of the team has "READER" permission. Project owners and project editors have "OWNER" permission.

All other permissions are removed. "AuthenticatedRead" gives the object owner "OWNER" permission and gives all

authenticated Google account holders "READER" permission. All other permissions are removed. "PublicRead"

gives the object owner "OWNER" permission and gives all users "READER" permission. All other permissions are

removed. "BucketOwnerRead" gives the object owner "OWNER" permission and the bucket owner "READER" permission.

All other permissions are removed. "BucketOwnerFullControl" gives the object and bucket owners "OWNER"

permission. All other permissions are removed.



To set fine-grained (e.g. individual users or domains) ACLs using PowerShell, use Add-GcsObjectAcl cmdlets.



Possible values: AuthenticatedRead, BucketOwnerFullControl, BucketOwnerRead, Private__, ProjectPrivate,

PublicRead



Required? false

Position? named

Default value

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

Google.Apis.Storage.v1.Data.Object

Storage object instance to update.





OUTPUTS

Google.Apis.Storage.v1.Data.Object





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



PS C:\\> Set-GcsObject -Bucket "widget-co-logs" -ObjectName "my-object" -PredefinedAcl PublicRead



Sets the ACL on object "my-object" in bucket "widget-co-logs" to PublicRead.

---------- EXAMPLE 2 ----------



PS C:\\> cd gs:\\my-bucket

PS gs:\\my-bucket> Set-GcsObject -ObjectName "my-object" -PredefinedAcl PublicRead



Sets the ACL on object "my-object" in bucket "my-bucket" to PublicRead.



RELATED LINKS