Links
       
S3Nas PowerShell Provider
Location: BlogsS3 Network Attached Storage    
Posted by: Timothy Russell 8/15/2007 5:17 PM
A PowerShell Provider for Amazon S3 with C# source code

S3Nas for PowerShell is a partially functional PowerShell Provider for the Amazon Simple Storage Service (S3).

Things that work:

  • Creating a connection to the Amazon S3 service and displaying it as a drive, i.e. S3Nas:\
  • Listing the buckets for an account and listing the contents of a bucket with wildcard support. i.e. ls s*
  • Tab completion of bucket names and key names
  • Get-Item and Set-Item as a String or Byte[]
  • Get-Acl on a bucket or key
  • Rename-Item (currently requires downloading the object and uploading it with a different name - there is an example of doing this via script in the project) This is actually a limitation of the Amazon S3 service at the moment as key names are immutable.

Things that don't work:

  • Set-Acl (have not figured out ObjectSecurity yet)
  • Copy-Item (it appears you can only use this within a namespace so perhaps it is not possible to do the following: copy-item -path S3Nas:\bucket\key -destination C:\filename

To get it working, you will need to fill in your Access and Secret Access keys in the S3NasAuthentication.cs file and compile it. Then modify the paths in the registration script and execute it.

Unfortunately, the documentation on building PowerShell providers is still a bit sparse at this point. Suggestions from enlightened individuals are welcome.

Download the source

Last updated:

  • 08/17/07, Fixed a delimiter problem for Get-Item on keys created using other programs that access S3 in hierarchy mode, such as S3Fox
  • 08/15/07, Initial release

Permalink |  Trackback

Comments (5)   Add Comment
Re: S3Nas PowerShell Provider    By Terrence Spencer on 8/17/2007 10:22 PM
I have not downloaded it yet, but Tim this is kick a$$.

Thanks

Re: S3Nas PowerShell Provider    By Timothy Lee Russell on 8/17/2007 10:27 PM
Terrence,

Thanks -- it's still a work in progress, let me know your true feelings once you try it out. :-)

Timothy

Re: S3Nas PowerShell Provider    By qawsqa on 8/19/2007 8:37 PM
niccccce!!

Re: S3Nas PowerShell Provider    By brad schafer on 4/12/2008 12:35 PM
Does powershell support the ability to 'run as a service' and therefore map a UNC path as a service? This is something we're looking to implement with the s3 cloud.

Re: S3Nas PowerShell Provider    By Timothy Lee Russell on 4/13/2008 11:45 AM
Brad,

Powershell can be hosted in a runspace which is a Powershell instance embedded in a C# application.

You can write a C# application that is a service, so I would say that it is possible, although I haven't tried it.

Timothy


Your name:
Title:
Comment:
Add Comment   Cancel 
 
S3 Network Attached Storage
    
S3 Network Attached Storage
    
Copyright (c) 2008 S3 Network Attached Storage