en-us/Building_with_Blob_Storage.walkthru.help.txt

<#
 
 
Sometimes structured storage isn't really what you're after. Sometimes, you just want to throw a blob of bytes into the cloud and call it a day.
 
 
For these times, Pipeworks provides commands to interact with Azure Blob Storage. To run this demo yourself, you need to use Add-SecureSetting to set up your access keys first.
 
 
Let's start off by enumerating all blobs:
#>
 
Get-Blob -StorageAccount (Get-SecureSetting AzureStorageAccountName -ValueOnly) -StorageKey (Get-SecureSetting AzureStorageAccountKey -ValueOnly)
 
 
<#
 
Now let's thru some files in a new container: -Public makes the container public
#>
 
Get-Module Pipeworks |
    Split-Path |
    Join-Path -ChildPath en-us |
    Get-ChildItem |
    Export-Blob -Container PipeworksDemos -Public
 
 
<#
 
To list items in the container, we use Get-Blob again
#>
Get-Blob -Container PipeworksDemos
 
 
<#
 
Let's open up a random on in the browser
 
#>
Get-Blob -Container PipeworksDemos | Get-Random | Foreach-Object { Start-Process -FilePath $_.Url }
 
 
<#
 
To import the data in the blob, you can either pipe container results of Get-Blob back to Get-Blob (which will return the data and the URL and modification time), or you can use Import-Blob
#>
 
 # Return the blob and containing data
Get-Blob -Container PipeworksDemos | Select-Object -First 1 | Get-Blob
 
 
 # Just import the data
Get-Blob -Container PipeworksDemos | Select-Object -First 1 | Import-Blob
 
 
 
<#
 
To remove items from blob storage, we can use Remove-Blob
#>
Get-Blob -Container PipeworksDemos | Select-Object -First 1 | Remove-Blob -Confirm:$false
 
 
<#
 
We can also remove the whole container:
#>
 
Remove-Blob -Container PipeworksDemos -Confirm:$false