Keep your Data back up to Cloud Storage

Keep your Data back up to Cloud Storage

This page tells the best way to reinforce information from a nearby machine to Distributed storage involving Cloud Devices for PowerShell. Dissimilar to most assets, Cloud Apparatuses for PowerShell gives two methods for getting to Distributed storage assets, the cmdlets and a PowerShell supplier.

The supplier permits you to get to Capacity pails and items like a record framework, utilizing the document framework orders you are as of now acquainted with. The supplier has a few limits, notwithstanding. Not all legitimate article names convert to lawful supplier ways. You can’t utilize the supplier to oversee upper leg tendons. For these high-level cases, you can utilize the cmdlets. See the Cloud Devices for PowerShell cmdlet reference to study Distributed storage cmdlets.

Transferring information

Information in Distributed storage is coordinated into pails. Make another pail as follows:

• Cmdlets

Utilize the New-GcsBucket cmdlet to make another can:

$container = “my-gcs-pail”
New-GcsBucket $bucket

• Supplier

Containers are organizers at the base of the gs:\ drive. Making another thing at that level will make another container.

compact disc gs:\
$can = “my-gcs-pail”
mkdir $bucket

Transfer documents to a pail

You can transfer a solitary document or a whole index to your container:

• Cmdlets

Utilize New-GcsObject. This requires an objective can and an article name as boundaries. Where the new Stockpiling article’s substance comes from relies upon which boundary set you to use.

You can transfer the substance of a neighborhood record to Distributed storage by utilizing the – Document boundary and indicating a record way. Then again, you can pass the article’s substance as a string using the PowerShell pipeline, or you can utilize the – Worth boundary.

You can transfer a whole catalog from the nearby circle to Distributed storage by utilizing the – Envelope boundary and determining the organizer way. Assuming you don’t need the envelope to be transferred straightforwardly to the base of the Distributed storage pail, use – ObjectNamePrefix to determine a prefix that will be applied to each protest transferred.

Transfer the organizer LogFiles and its substance to the foundation of the gadget container.

New-GcsObject – Can “gadget” – Envelope “C:\inetpub\logs\LogFiles”

Transfer the organizer LogFiles and its substance to catalog Test in the gadget container.

New-GcsObject – Can “gadget” – Envelope “C:\inetpub\logs\LogFiles” – ObjectNamePrefix “Test”

• Supplier

Utilize New-Thing. It requires a way to the thing being made. This can be an outright way or a relative way. The substance of the new Stockpiling Item can be determined either as a string to the – Worth boundary or by indicating a documented way to the – Record boundary.

New-Thing gs:\my-gcs-bucket\new-object – Record $file

The accompanying scrap transfers a whole catalog from the neighborhood circle to Distributed storage.

compact disc $folder
$documents = Get-ChildItem – Recurse
$information = @()
foreach ($file in $files) {
$objectPath = $file | Resolve-Way – Relative
$information += @{file = $file; objectPath = $objectPath}
}
compact disc gs:\my-gcs-container
foreach($element in $data) {
Compose Host “‘t${$element.objectPath}”
New-Thing $element.objectPath – Record $element.file
}

Looking through information

You can look through information with cmdlets, or with the supplier through the normal document search cmdlets.

• Cmdlets

You can look through a can’s articles utilizing Get-GcsObject. This can be helpful when joined with the Out-GridView cmdlet to picture your information:

Get-GcsObject $bucket | Select Name, Size | Out-GridView

• Supplier

You can utilize Get-ChildItem or one of its nom de plumes: dir, ls, or GCI. You can utilize the – Recurse boundary to search inside the legitimate envelopes as a whole:

compact disc gs:\my-gcs-can
ls – Recurse

Understanding information

To peruse information through the supplier, utilize the standard Get-Content cmdlet. On the other hand, utilize the Read-GcsObject cmdlet.

• Cmdlets

To peruse the substance of a Distributed storage object, utilize the Read-GcsObject cmdlet. Of course, it peruses the item’s substance as a string and composes it to the PowerShell pipeline. You can indicate the – OutFile boundary to download the item’s substance to the neighborhood circle all things considered:

Peruse GcsObject $bucket “timestamp.txt” | Compose Host
Peruse GcsObject $bucket “logo.png” ‘
-OutFile “$Env:UserProfile\pictures\logo.png”

• Supplier

To peruse the substance of a Distributed storage object, utilize the Get-Content cmdlet, or one of its nom de plumes: feline, GC, or type.

cd gs:\my-gcs-pail
feline my-object-name

Erasing information

To erase information through the supplier, utilize the standard Eliminate Thing cmdlet. Then again, utilize the Eliminate GcsObject cmdlet.

• Cmdlets

To eliminate any information in Distributed storage, utilize the Eliminate GcsObject cmdlet:

Get-GcsObject $bucket | Eliminate GcsObject

• Supplier

To eliminate information in Distributed storage, utilize the Eliminate Thing cmdlet, or one of its nom de plumes del, rm, eradicate:

cd gs:\my-gcs-container
rm my-object-name