mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-26 06:48:13 +00:00
2974ead76ea97869c02ccf7d1279a5c968f86945
Key Achievements: - Downgraded to MinIO 4.0.7 for PowerShell compatibility (eliminated async/await issues) - Fixed file handle leaks in upload operations (using explicit FileStream management) - Implemented clean logging (timestamps without redundant prefixes) - Fixed automatic session variable management (Connect-MinIO stores, cmdlets retrieve) - Removed duplicate certificate parameters (kept only SkipCertificateValidation) - Fixed all 'Folder' alias conflicts across cmdlets - Added correct System.Runtime.CompilerServices.Unsafe.dll version (4.5.3) Working Features: - Connection management (automatic + explicit override) - Bucket operations (list, create, remove) - File upload/download (with proper handle release) - Progress tracking and speed reporting - Clean verbose logging with timestamps Known Issue: - Chunked operations have threading violations (PowerShell cmdlet methods called from background threads) - Regular operations work perfectly, chunked operations need threading architecture fix Test Results: - 3.71GB Windows install.wim file tested - Regular upload/download: Working - File handles: No leaks, immediate deletion possible - Session management: Automatic connection storage/retrieval - Chunked operations: Threading violations need fix
PSMinIO
A fully-fledged C# PowerShell binary module built on top of the Minio .NET SDK for managing MinIO object storage operations.
Features
- Cross-Platform Compatibility: Built for .NET Standard 2.0, compatible with PowerShell 5.1+ and PowerShell 7+
- Comprehensive Bucket Operations: Create, list, delete, and check bucket existence
- Object Management: Upload, download, list, and delete objects with progress tracking
- Security & Policy Management: Manage bucket policies and access controls
- Synchronous Operations: All operations are synchronous for PowerShell compatibility
- Detailed Logging: Centralized logging with timestamps when
-Verboseis specified - Progress Reporting: Upload/download progress with percentages and time estimates
Installation
# Import the module
Import-Module .\PSMinIO.psd1
Quick Start
# Configure connection
Set-MinIOConfig -Endpoint 'https://minio.myorg.com' -AccessKey 'AKIA...' -SecretKey 'abc123' -UseSSL
# Create a bucket
New-MinIOBucket -BucketName 'my-bucket' -Verbose
# Upload a file
New-MinIOObject -BucketName 'my-bucket' -ObjectName 'data.txt' -FilePath 'C:\data.txt'
# List objects
Get-MinIOObject -BucketName 'my-bucket' -Prefix '2025/'
# Download an object
Get-MinIOObjectContent -BucketName 'my-bucket' -ObjectName 'data.txt' -FilePath 'C:\downloaded-data.txt'
Cmdlets
Bucket Operations
Get-MinIOBucket- Lists all bucketsNew-MinIOBucket- Creates a new bucketRemove-MinIOBucket- Deletes a bucketTest-MinIOBucketExists- Checks if a bucket exists
Object Operations
Get-MinIOObject- Lists objects in a bucketNew-MinIOObject- Uploads a file to a bucketGet-MinIOObjectContent- Downloads an objectRemove-MinIOObject- Deletes an object
Security & Policy
Get-MinIOBucketPolicy- Retrieves bucket policySet-MinIOBucketPolicy- Sets bucket policy
Utility
Get-MinIOConfig- Shows current configurationSet-MinIOConfig- Sets connection configurationGet-MinIOStats- Displays statistics and metrics
Requirements
- PowerShell 5.1+ or PowerShell 7+
- .NET Framework 4.7.2+ (for PowerShell 5.1) or .NET Core/.NET 5+ (for PowerShell 7+)
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Languages
C#
89.5%
PowerShell
10.5%