< Back
Remove-GcsObject
Post
NAME Remove-GcsObject
SYNOPSIS
Deletes a Cloud Storage object.
SYNTAX
Remove-GcsObject [[-Bucket] <string>] [-ObjectName] <string> [<CommonParameters>]
Remove-GcsObject [-InputObject] <Object> [<CommonParameters>]
DESCRIPTION
Deletes a Cloud Storage object.
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 containing the object. 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 delete.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InputObject <Object>
Name of the object to delete.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Object <Object>
Name of the object to delete.
This is an alias of the InputObject parameter.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
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
Name of the object to delete.
OUTPUTS
---------- EXAMPLE 1 ----------
PS C:\\> Remove-GcsObject ppiper-prod text-files/14683615 -WhatIf
Delete storage object named "text-files/14683615".
---------- EXAMPLE 2 ----------
PS C:\\> cd gs:\\my-bucket
PS gs:\\my-bucket> Remove-GcsObject -ObjectName "my-object"
Removes the storage object "my-object" in bucket "my-bucket".
RELATED LINKS
SYNOPSIS
Deletes a Cloud Storage object.
SYNTAX
Remove-GcsObject [[-Bucket] <string>] [-ObjectName] <string> [<CommonParameters>]
Remove-GcsObject [-InputObject] <Object> [<CommonParameters>]
DESCRIPTION
Deletes a Cloud Storage object.
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 containing the object. 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 delete.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InputObject <Object>
Name of the object to delete.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Object <Object>
Name of the object to delete.
This is an alias of the InputObject parameter.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
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
Name of the object to delete.
OUTPUTS
---------- EXAMPLE 1 ----------
PS C:\\> Remove-GcsObject ppiper-prod text-files/14683615 -WhatIf
Delete storage object named "text-files/14683615".
---------- EXAMPLE 2 ----------
PS C:\\> cd gs:\\my-bucket
PS gs:\\my-bucket> Remove-GcsObject -ObjectName "my-object"
Removes the storage object "my-object" in bucket "my-bucket".
RELATED LINKS