Initial commit: PSMinIO module with chunked transfer support

This commit is contained in:
PSMinIO Developer
2025-07-10 12:58:44 -04:00
parent a306ade1f3
commit 5fdcd31d5e
40 changed files with 9899 additions and 1 deletions
+198
View File
@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<ViewDefinitions>
<!-- MinIOBucketInfo Table View -->
<View>
<Name>PSMinIO.Models.MinIOBucketInfo</Name>
<ViewSelectedBy>
<TypeName>PSMinIO.Models.MinIOBucketInfo</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Name</Label>
<Width>25</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Created</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Region</Label>
<Width>15</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>CreatedFormatted</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Region</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!-- MinIOObjectInfo Table View -->
<View>
<Name>PSMinIO.Models.MinIOObjectInfo</Name>
<ViewSelectedBy>
<TypeName>PSMinIO.Models.MinIOObjectInfo</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Name</Label>
<Width>30</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Size</Label>
<Width>12</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>LastModified</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>ETag</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>SizeFormatted</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>LastModifiedFormatted</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ETag</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!-- MinIOConfiguration Table View -->
<View>
<Name>PSMinIO.Models.MinIOConfiguration</Name>
<ViewSelectedBy>
<TypeName>PSMinIO.Models.MinIOConfiguration</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Endpoint</Label>
<Width>30</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>AccessKey</Label>
<Width>15</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>SecretKey</Label>
<Width>15</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>UseSSL</Label>
<Width>8</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>EndpointDisplay</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>AccessKeyMasked</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>SecretKeyMasked</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>UseSSL</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!-- MinIOStats Table View -->
<View>
<Name>PSMinIO.Models.MinIOStats</Name>
<ViewSelectedBy>
<TypeName>PSMinIO.Models.MinIOStats</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TotalBuckets</Label>
<Width>15</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>TotalObjects</Label>
<Width>15</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>TotalSize</Label>
<Width>15</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>LastUpdated</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>TotalBuckets</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>TotalObjects</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>TotalSizeFormatted</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>LastUpdated</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
+258
View File
@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="utf-8"?>
<Types>
<Type>
<Name>PSMinIO.Models.MinIOBucketInfo</Name>
<Members>
<ScriptProperty>
<Name>CreatedFormatted</Name>
<GetScriptBlock>
$this.Created.ToString("yyyy-MM-dd HH:mm:ss")
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>SizeFormatted</Name>
<GetScriptBlock>
if ($this.Size -eq $null) { return "N/A" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.Size
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<Type>
<Name>PSMinIO.Models.MinIOObjectInfo</Name>
<Members>
<ScriptProperty>
<Name>LastModifiedFormatted</Name>
<GetScriptBlock>
$this.LastModified.ToString("yyyy-MM-dd HH:mm:ss")
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>SizeFormatted</Name>
<GetScriptBlock>
if ($this.Size -eq $null) { return "N/A" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.Size
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>GetFileName</Name>
<GetScriptBlock>
if ($this.Name -eq $null) { return "" }
$parts = $this.Name.Split('/')
return $parts[$parts.Length - 1]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>HasPresignedUrl</Name>
<GetScriptBlock>
return -not [string]::IsNullOrEmpty($this.PresignedUrl)
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PresignedUrlValid</Name>
<GetScriptBlock>
if ($this.PresignedUrlExpiration -eq $null) { return $false }
return $this.PresignedUrlExpiration -gt [DateTime]::UtcNow
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<Type>
<Name>PSMinIO.Models.MinIOConfiguration</Name>
<Members>
<ScriptProperty>
<Name>EndpointDisplay</Name>
<GetScriptBlock>
if ($this.UseSSL) {
return "https://$($this.Endpoint)"
} else {
return "http://$($this.Endpoint)"
}
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>AccessKeyMasked</Name>
<GetScriptBlock>
if ([string]::IsNullOrEmpty($this.AccessKey)) { return "Not Set" }
if ($this.AccessKey.Length -le 4) { return $this.AccessKey }
return $this.AccessKey.Substring(0, 4) + "*".PadRight($this.AccessKey.Length - 4, '*')
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>SecretKeyMasked</Name>
<GetScriptBlock>
if ([string]::IsNullOrEmpty($this.SecretKey)) { return "Not Set" }
return "*".PadRight($this.SecretKey.Length, '*')
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>SecurityStatus</Name>
<GetScriptBlock>
if ($this.SkipCertificateValidation) {
return "SSL (Certificate Validation Disabled)"
} elseif ($this.UseSSL) {
return "SSL (Secure)"
} else {
return "HTTP (Insecure)"
}
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<Type>
<Name>PSMinIO.Models.MinIOStats</Name>
<Members>
<ScriptProperty>
<Name>TotalSizeFormatted</Name>
<GetScriptBlock>
if ($this.TotalSize -eq $null) { return "N/A" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.TotalSize
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<!-- ChunkedTransferState Type -->
<Type>
<n>PSMinIO.Models.ChunkedTransferState</n>
<Members>
<ScriptProperty>
<n>ProgressFormatted</n>
<GetScriptBlock>
return "{0:F1}%" -f $this.ProgressPercentage
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>BytesTransferredFormatted</n>
<GetScriptBlock>
if ($this.BytesTransferred -eq $null) { return "0 B" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.BytesTransferred
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>TotalSizeFormatted</n>
<GetScriptBlock>
if ($this.TotalSize -eq $null) { return "0 B" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.TotalSize
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>ChunkSizeFormatted</n>
<GetScriptBlock>
if ($this.ChunkSize -eq $null) { return "0 B" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.ChunkSize
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>ElapsedTime</n>
<GetScriptBlock>
if ($this.StartTime -eq $null) { return "Unknown" }
$elapsed = [DateTime]::UtcNow - $this.StartTime
return $elapsed.ToString("hh\:mm\:ss")
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>TransferStatus</n>
<GetScriptBlock>
if ($this.IsComplete) {
return "Complete"
} elseif ($this.CompletedChunkCount -gt 0) {
return "In Progress"
} else {
return "Not Started"
}
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>RemainingChunks</n>
<GetScriptBlock>
return $this.TotalChunks - $this.CompletedChunkCount
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<!-- ChunkInfo Type -->
<Type>
<n>PSMinIO.Models.ChunkInfo</n>
<Members>
<ScriptProperty>
<n>SizeFormatted</n>
<GetScriptBlock>
if ($this.Size -eq $null) { return "0 B" }
$sizes = @("B", "KB", "MB", "GB", "TB", "PB")
$index = 0
$size = $this.Size
while ($size -ge 1024 -and $index -lt $sizes.Length - 1) {
$size = $size / 1024
$index++
}
return "{0:F2} {1}" -f $size, $sizes[$index]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>ChunkRange</n>
<GetScriptBlock>
return "{0}-{1}" -f $this.StartByte, $this.EndByte
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<n>Status</n>
<GetScriptBlock>
if ($this.IsCompleted) {
return "Completed"
} elseif ($this.RetryCount -gt 0) {
return "Failed ({0} retries)" -f $this.RetryCount
} else {
return "Pending"
}
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
</Types>