< Back

Test-GcsObject

Mon Jan 13, 2020 11:55 pm

NAME Test-GcsObject



SYNOPSIS

Verify the existence of a Cloud Storage Object.





SYNTAX

Test-GcsObject [[-Bucket] <string>] [-ObjectName] <string> [<CommonParameters>]





DESCRIPTION

Verify the existence of 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 containing bucket. 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 check for.



Required? true

Position? 1

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



OUTPUTS

System.Boolean





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



PS C:\\> Test-GcsObject -Bucket "widget-co-logs" -ObjectName "status.txt"



Test if an object named "status.txt" exists in the bucket "widget-co-logs".

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



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

PS gs:\\my-bucket> Test-GcsObject -ObjectName "status.txt"



Test if an object named "status.txt" exists in the bucket "my-bucket".



RELATED LINKS