Aliyun OSS Powershell Core Provider (Unofficial)
Provide integrated Aliyun OSS functionality into Powershell navigation module.
- Download install.ps1 to your PC.
- Launch Powershell Core command in Administrator mode.
- Run the downloaded install.ps1.
- Upon installation completion run the following command to import the module.
Import-Module Aliyun.Provider.OSS
- Create PS Drive named 'OSSD' with the required parameters.
New-PSDrive -PSProvider OSS -Root "" -Name OSSD `
-Endpoint <your endpoint> `
-AccessKeyId <your access key> `
-AccessKeySecret <your access key secet> `
-BucketName <your bucket name>
- Run any supported item commands.
# Create new item in OSSD drive
# -Path <PSDriveName>:<Path> -SourcePath <your local file>
New-Item -Path 'OSSD:/newfolder/ket.yr' -SourcePath 'c:\test.path'
- Remove PS Drive 'OSSD' once you done.
Remove-PSDrive OSSD
Pull image command
docker pull kokleong98/aliyun.provider.oss
Run container image command
docker run -it kokleong98/aliyun.provider.oss
Run container image with environment variable
# Multlple lines docker command
docker run -it \
-e Endpoint=<your endpoint> \
-e AccessKeyId=<your access key> \
-e AccessKeySecret=<your access key secret> \
-e BucketName=<your bucket name> \
-e Endpoint2=<your endpoint 2> \
-e AccessKeyId2=<your access key 2> \
-e AccessKeySecret2=<your access key secret 2> \
-e BucketName2=<your bucket name 2> \
kokleong98/aliyun.provider.oss
- Get-ChildItem (Partial support) - List item under 'OSSD' PS Drive.
Get-ChildItem OSSD:/
- cd - Change directory in 'OSSD' PS Drive.
cd OSSD:/
- New-Item - Create an object in OSS
# Create new item in OSSD drive using local source path
# -Path <PSDriveName>:<Path> -SourcePath <your local file>
New-Item -Path 'OSSD:/newfolder/oss.dat' -SourcePath 'c:\oss.dat'
# Create new item in OSSD drive using bytes array
# -Path <PSDriveName>:<Path> -Blob <your bytes array variable>
New-Item -Path 'OSSD:/newfolder/oss.dat' -Blob $blob
- Set-Item - Update an object in OSS
# Update item in OSSD drive using local source path
# -Path <PSDriveName>:<Path> -SourcePath <your local file>
Set-Item -Path 'OSSD:/newfolder/oss.dat' -SourcePath 'c:\oss.dat'
- Get-Item - Get OSS object metadata
Get-Item -Path 'OSSD:/newfolder/oss.dat'
- Get-Content (Partial support) - Download OSS object content
# Download OSS object content in OSSD drive using local source path
# -Path <PSDriveName>:<Path> -OutputPath <your local file>
Get-Content -Path 'OSSD:/newfolder/oss.dat' -OutputPath '/root/oss.dat'
- Remove-Item - Remove an object in OSS
# Remove item in OSSD drive using local source path
# -Path <PSDriveName>:<Path>
Remove-Item -Path 'OSSD:/newfolder/oss.dat'
- Copy-Item (Partial support) - Copy an object in OSS
# Copy item in within OSSD drive
# <PSDriveName>:<Path>
Copy-Item 'OSSD:/newfolder/oss.dat' 'OSSD:/newfolder/oss2.dat'
# Copy item in between OSSD drives
# <PSDriveName>:<Path>
Copy-Item 'OSSD:/cloud.img' 'OSSD2:/newcloud.img'