NetCmdlets 2016
NetCmdlets 2016
Questions / Feedback?

Get-CloudStorage Cmdlet

Parameters   Output Objects   Configuration Settings  

The Get-CloudStorage cmdlet is used to download files and retrieve directory listings from Cloud Storage providers.


Get-CloudStorage [parameters]


To list a directory, set the List parameter to the remote path of the target directory. Passing "/" as the List parameter will list the root directory of the remote host.

To download files or entire directories, set the RemoteFile parameter to the name of the target file or directory. Wildcards (*) can be used to download multiple files. When downloading multiple files or a directory, the LocalFile parameter must be set to the local directory where the target files/directory should be stored. When downloading a single file, the LocalFile parameter must be set to the local path and file name to the file where the downloaded content will be stored. If the local file already exists, the Overwrite switch must be passed to overwrite the local file.

The following cloud storage providers require OAuth authentication:

  • Box
  • DropBox
  • GoogleDrive
  • OneDrive

For each of these providers, OAuthClientId and OAuthClientSecret are required to generate the OAuth token. The cmdlet will automatically fetch and cache OAuth tokens, which requires user-interaction the first time. Once the token has been cached the cmdlet will automatically use and refresh this token without additional interaction. The OAuthCacheDir parameter governs the location of the OAuth cache files, and passing the empty string to this parameter will disable OAuth caching entirely.

Service providers that do not require OAuth authentication have dedicated parameters for the necessary account credentials:

The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.

#list all buckets (the root directory) for Amazon S3
Get-CloudStorage -ServiceProvider Amazons3 -AmazonS3AccessKey $accesskey -AmazonS3SecretKey $secretkey -List "/"

#download all text files from a subfolder of Box
Get-CloudStorage -ServiceProvider Box -OAuthClientId $boxid -OAuthClientSecret $boxsecret -RemoteFile "test/*.txt" -LocalFile "C:/test"

#download a single file from Wasabi
Get-CloudStorage -ServiceProvider Wasabi -WasabiAccessKey $accesskey -WasabiSecretKey $secretkey -RemoteFile "Apple.txt" -LocalFile "C:/test/downloaded_apple.txt"

#download an entire directory from DropBox
Get-CloudStorage -ServiceProvider DropBox -OAuthClientId $dropboxid -OAuthClientSecret $dropboxsecret -RemoteFile "folder/subfolder" -LocalFile "C:/test"

Connection Handling

This cmdlet supports persistent connections through the Connection parameter. To establish a new CloudStorage connection, use the Connect-CloudStorage cmdlet. To close the connection, use the Disconnect-CloudStorage cmdlet.

Parameter List

The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

ConnectionAn already established connection.
LogFileThe location of a file to which debug information is written.
AmazonS3AccessKeyAccount credential for Amazon S3.
AmazonS3SecretKeyAccount credential for Amazon S3.
AzureAccountCredential for the Azure Blob service.
AzureBlobAccessKeyCredential for the Azure Blob service.
CertPasswordThe password to the certificate store.
CertStoreThe name of the certificate store for the client certificate.
CertStoreTypeThe type of certificate store for the client certificate.
CertSubjectThe subject of the certificate used for client authentication.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for user/password authentication.
EncryptionAlgorithmThe encryption algorithm.
EncryptionPasswordThe encryption password.
ForceForces the cmdlet to accept the default behavior instead of querying the user.
ListGet a directory listing for the path and file mask specified.
LocalFileThe local file to download to.
LogFileThe location of a file to which debug information is written.
OAuthCacheDirThe directory where OAuth settings will be stored.
OAuthClientIdAccount credential for services that require OAuth authentication.
OAuthClientSecretAccount credential for services that require OAuth authentication.
OAuthWebServerPortThe port on the local machine where the OAuth web server will listen.
OverwriteIndicates whether the LocalFile may be overwritten.
RemoteFileThe name of the remote file(s)/directory to download.
ServiceProviderThe storage service provider.
SharePointPasswordAccount credential for SharePoint.
SharePointURLAccount credential for SharePoint.
SharePointUserAccount credential for SharePoint.
TimeoutThe maximum time allowed for the operation.
WasabiAccessKeyAccount credential for Wasabi.
WasabiSecretKeyAccount credential for Wasabi.

Output Objects

The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.

EntryInfoThis object contains details about a file returned from the Cloud Storage provider.

Configuration Settings

The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.

DateFormatThe date format of the file time.
DocsExportFormatThe file format to export Google Docs files as when downloading.
DrawingsExportFormatThe file format to export Google Drawings files as when downloading.
SheetsExportFormatThe file format to export Google Sheets files as when downloading.
SlidesExportFormatThe file format to export Google Slides files as when downloading.
NormalizedFileName[i]The normalized file name.
EncryptionIVThe initialization vector to be used for encryption/decryption.
EncryptionKeyThe key to use during encryption/decryption.
AcceptEncodingUsed to tell the server which types of content encodings the client supports.
AllowHTTPCompressionThis property enables HTTP compression for receiving data.
AllowHTTPFallbackWhether HTTP/2 connections are permitted to fallback to HTTP/1.1.
AppendWhether to append data to LocalFile.
AuthorizationThe Authorization string to be sent to the server.
BytesTransferredContains the number of bytes transferred in the response data.
EncodeURLIf set to true the URL will be encoded by the cmdlet.
FollowRedirectsDetermines what happens when the server issues a redirect.
GetOn302RedirectIf set to true the cmdlet will perform a GET on the new location.
HTTPVersionThe version of HTTP used by the cmdlet.
IfModifiedSinceA date determining the maximum age of the desired document.
KeepAliveDetermines whether the HTTP connection is closed after completion of the request.
LogLevelThe level of detail that is logged.
MaxRedirectAttemptsLimits the number of redirects that are followed in a request.
NegotiatedHTTPVersionThe negotiated HTTP version.
OtherHeadersOther headers as determined by the user (optional).
ProxyAuthorizationThe authorization string to be sent to the proxy server.
ProxyAuthSchemeThe authorization scheme to be used for the proxy.
ProxyPasswordA password if authentication is to be used for the proxy.
ProxyPortPort for the proxy server (default 80).
ProxyServerName or IP address of a proxy server (optional).
ProxyUserA user name if authentication is to be used for the proxy.
TransferredDataThe contents of the last response from the server.
TransferredDataLimitThe maximum number of incoming bytes to be stored by the cmdlet.
TransferredHeadersThe full set of headers as received from the server.
UseChunkedEncodingEnables or Disables HTTP chunked encoding for transfers.
ChunkSizeSpecifies the chunk size in bytes when using chunked encoding.
UserAgentInformation about the user agent (browser).
KerberosSPNThe Service Principal Name for the Kerberos Domain Controller.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the cmdlet whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the cmdlet binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
UseIPv6Whether to use IPv6.
TcpNoDelayWhether or not to delay when sending packets.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
UseBackgroundThreadWhether threads created by the cmdlet are background threads.
UseInternalSecurityAPITells the cmdlet whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2018 /n software inc. - All rights reserved.
NetCmdlets 2016 - Version 16.0 [Build 6592]