mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-27 07:08:56 +00:00
2974ead76e
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
40 lines
1.7 KiB
PowerShell
40 lines
1.7 KiB
PowerShell
# Debug test for PSMinIO module
|
|
Import-Module ./Module/PSMinIO/PSMinIO.psd1 -Force
|
|
|
|
Write-Host "=== PSMinIO Debug Test ===" -ForegroundColor Cyan
|
|
|
|
# Test credentials
|
|
$endpoint = "https://api.s3.gracesolution.info"
|
|
$accessKey = "T34Wg85SAwezUa3sk3m4"
|
|
$secretKey = "PxEmnbQoQJTJsDocSEV6mSSscDpJMiJCayPv93xe"
|
|
|
|
Write-Host "1. Connecting..." -ForegroundColor Yellow
|
|
try {
|
|
$connection = Connect-MinIO -Endpoint $endpoint -AccessKey $accessKey -SecretKey $secretKey
|
|
Write-Host "SUCCESS: Connected to $($connection.EndpointUrl)" -ForegroundColor Green
|
|
|
|
# Check if connection is stored in session variable
|
|
Write-Host "2. Checking session variable..." -ForegroundColor Yellow
|
|
$sessionConnection = Get-Variable -Name "MinIOConnection" -ErrorAction SilentlyContinue
|
|
if ($sessionConnection) {
|
|
Write-Host "SUCCESS: Session variable exists with value type: $($sessionConnection.Value.GetType().Name)" -ForegroundColor Green
|
|
Write-Host "Session connection endpoint: $($sessionConnection.Value.EndpointUrl)" -ForegroundColor Gray
|
|
} else {
|
|
Write-Host "FAILED: Session variable not found" -ForegroundColor Red
|
|
}
|
|
|
|
# Try to manually call Get-MinIOBucket with explicit connection
|
|
Write-Host "3. Testing with explicit connection..." -ForegroundColor Yellow
|
|
try {
|
|
$buckets = Get-MinIOBucket -MinIOConnection $connection
|
|
Write-Host "SUCCESS: Found $($buckets.Count) buckets with explicit connection" -ForegroundColor Green
|
|
} catch {
|
|
Write-Host "FAILED: $($_.Exception.Message)" -ForegroundColor Red
|
|
}
|
|
|
|
} catch {
|
|
Write-Host "FAILED: $($_.Exception.Message)" -ForegroundColor Red
|
|
}
|
|
|
|
Write-Host "Debug test completed!" -ForegroundColor Cyan
|