Fix test script parameter names to match actual cmdlet implementations

� PARAMETER NAME FIXES:

 CORRECTED CMDLET PARAMETERS:
  • New-MinIOObjectMultipart: -Files → -FilePath
  • Get-MinIOObjectContent: -ObjectKey → -ObjectName, -FilePath → -LocalPath
  • Get-MinIOObjectContentMultipart: -ObjectKey → -ObjectName, -FilePath → -DestinationPath
  • Get-MinIOPresignedUrl: -ObjectKey → -ObjectName

� UPDATED BOTH TEST SCRIPTS:
  • Test-PSMinIOIndividual.ps1 - Manual testing commands
  • Test-PSMinIOComprehensive.ps1 - Automated test suite
  • Fixed all parameter mismatches based on actual cmdlet implementations

� PARAMETER MAPPING:
  • ObjectKey/Key → ObjectName (consistent across all cmdlets)
  • Files → FilePath (for multipart upload)
  • FilePath → LocalPath (for single download)
  • FilePath → DestinationPath (for multipart download)

Now test scripts use correct parameter names matching the actual PSMinIO cmdlet implementations!
This commit is contained in:
PSMinIO Developer
2025-07-14 17:28:36 -04:00
parent b1adfa6328
commit ab7c2bbde2
2 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -100,7 +100,7 @@ try {
# Test 7: Upload large file (multipart)
Write-Verbose "Testing multipart upload..."
$multipartResult = New-MinIOObjectMultipart -BucketName $TestBucket -Files (Get-Item $LargeFile) -Verbose
$multipartResult = New-MinIOObjectMultipart -BucketName $TestBucket -FilePath (Get-Item $LargeFile) -Verbose
$testResults += [PSCustomObject]@{
Test = "Multipart Upload"
Status = "Success"
@@ -121,7 +121,7 @@ try {
# Test 9: Download small file
Write-Verbose "Testing single file download..."
$downloadPath = Join-Path $TestDirectory "downloaded-small.txt"
$downloadResult = Get-MinIOObjectContent -BucketName $TestBucket -ObjectKey "small-test.txt" -FilePath (New-Object System.IO.FileInfo $downloadPath) -Verbose
$downloadResult = Get-MinIOObjectContent -BucketName $TestBucket -ObjectName "small-test.txt" -LocalPath $downloadPath -Verbose
$testResults += [PSCustomObject]@{
Test = "Single File Download"
Status = "Success"
@@ -132,7 +132,7 @@ try {
# Test 10: Download large file (multipart)
Write-Verbose "Testing multipart download..."
$downloadPath2 = Join-Path $TestDirectory "downloaded-large.txt"
$multipartDownload = Get-MinIOObjectContentMultipart -BucketName $TestBucket -ObjectKey "large-test.txt" -FilePath (New-Object System.IO.FileInfo $downloadPath2) -Verbose
$multipartDownload = Get-MinIOObjectContentMultipart -BucketName $TestBucket -ObjectName "large-test.txt" -DestinationPath (New-Object System.IO.FileInfo $downloadPath2) -Verbose
$testResults += [PSCustomObject]@{
Test = "Multipart Download"
Status = "Success"
@@ -142,7 +142,7 @@ try {
# Test 11: Generate presigned URL
Write-Verbose "Testing presigned URL generation..."
$presignedUrl = Get-MinIOPresignedUrl -BucketName $TestBucket -ObjectKey "small-test.txt" -Expiration (New-TimeSpan -Hours 1) -Verbose
$presignedUrl = Get-MinIOPresignedUrl -BucketName $TestBucket -ObjectName "small-test.txt" -Expiration (New-TimeSpan -Hours 1) -Verbose
$testResults += [PSCustomObject]@{
Test = "Presigned URL"
Status = "Success"
+5 -5
View File
@@ -14,7 +14,7 @@ Write-Output ""
# ===== STEP 1: IMPORT MODULE =====
Write-Output "1. Import PSMinIO Module:"
Import-Module ".\Module\PSMinIO\PSMinIO.psd1" -Force -Verbose
Import-Module "..\Module\PSMinIO\PSMinIO.psd1" -Force -Verbose
# ===== STEP 2: CONNECT TO S3 =====
Write-Output "`n2. Connect to S3:"
@@ -68,7 +68,7 @@ $uploadResult2
# ===== STEP 9: UPLOAD LARGE FILE (MULTIPART) =====
Write-Output "`n9. Upload large file (multipart):"
$multipartResult = New-MinIOObjectMultipart -BucketName $TestBucket -Files (Get-Item $LargeFile) -Verbose
$multipartResult = New-MinIOObjectMultipart -BucketName $TestBucket -FilePath (Get-Item $LargeFile) -Verbose
$multipartResult
# ===== STEP 10: LIST OBJECTS IN BUCKET =====
@@ -79,18 +79,18 @@ $objects | Format-Table Key, @{Name="Size(KB)";Expression={[math]::Round($_.Size
# ===== STEP 11: DOWNLOAD SMALL FILE =====
Write-Output "`n11. Download small file:"
$downloadPath1 = Join-Path $TestDirectory "downloaded-small.txt"
$downloadResult1 = Get-MinIOObjectContent -BucketName $TestBucket -ObjectKey "small-test.txt" -FilePath (New-Object System.IO.FileInfo $downloadPath1) -Verbose
$downloadResult1 = Get-MinIOObjectContent -BucketName $TestBucket -ObjectName "small-test.txt" -LocalPath $downloadPath1 -Verbose
$downloadResult1
# ===== STEP 12: DOWNLOAD LARGE FILE (MULTIPART) =====
Write-Output "`n12. Download large file (multipart):"
$downloadPath2 = Join-Path $TestDirectory "downloaded-large.txt"
$multipartDownload = Get-MinIOObjectContentMultipart -BucketName $TestBucket -ObjectKey "large-test.txt" -FilePath (New-Object System.IO.FileInfo $downloadPath2) -Verbose
$multipartDownload = Get-MinIOObjectContentMultipart -BucketName $TestBucket -ObjectName "large-test.txt" -DestinationPath (New-Object System.IO.FileInfo $downloadPath2) -Verbose
$multipartDownload
# ===== STEP 13: GENERATE PRESIGNED URL =====
Write-Output "`n13. Generate presigned URL:"
$presignedUrl = Get-MinIOPresignedUrl -BucketName $TestBucket -ObjectKey "small-test.txt" -Expiration (New-TimeSpan -Hours 1) -Verbose
$presignedUrl = Get-MinIOPresignedUrl -BucketName $TestBucket -ObjectName "small-test.txt" -Expiration (New-TimeSpan -Hours 1) -Verbose
$presignedUrl
# ===== STEP 14: VERIFY DOWNLOADED FILES =====