mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-26 14:58:13 +00:00
Consolidate Module and Publish folders - reduce DLLs to essentials
✅ FOLDER CONSOLIDATION: • Removed redundant Publish folder • Migrated all content to Module folder • Centralized module distribution in single location ✅ DLL OPTIMIZATION: • Removed MinIO SDK dependency (Minio.dll) - no longer needed • Kept only essential DLLs: - PSMinIO.dll (main module) - PSMinIO.pdb (debugging symbols) - System.Text.Json.dll (JSON operations) - Newtonsoft.Json.dll (JSON compatibility) • Updated manifest to reflect minimal dependencies ✅ MANIFEST UPDATES: • Updated description to reflect custom REST API implementation • Removed Minio.dll from RequiredAssemblies • Updated FileList with essential DLLs only • Maintained all comprehensive cmdlet exports ✅ BENEFITS: • Reduced module size and dependencies • Eliminated MinIO SDK async/PowerShell compatibility issues • Cleaner distribution with minimal footprint • Single source of truth for module files Module now contains only essential files for optimal PowerShell compatibility.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
Copyright = '(c) 2025 Grace Solutions. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'A comprehensive PowerShell module for MinIO object storage operations with enterprise-grade features including chunked transfers, advanced object listing, directory management, and performance monitoring. Built on the official Minio .NET SDK.'
|
||||
Description = 'A comprehensive PowerShell module for MinIO object storage operations with enterprise-grade features including multipart uploads/downloads, presigned URLs, bucket policies, advanced metadata handling, and performance monitoring. Built with custom REST API implementation for optimal PowerShell compatibility.'
|
||||
|
||||
# Minimum version of the PowerShell engine required by this module
|
||||
PowerShellVersion = '5.1'
|
||||
@@ -98,6 +98,9 @@
|
||||
FileList = @(
|
||||
'PSMinIO.psd1',
|
||||
'bin\PSMinIO.dll',
|
||||
'bin\PSMinIO.pdb',
|
||||
'bin\System.Text.Json.dll',
|
||||
'bin\Newtonsoft.Json.dll',
|
||||
'types\PSMinIO.Types.ps1xml',
|
||||
'types\PSMinIO.Format.ps1xml'
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,172 +0,0 @@
|
||||
@{
|
||||
# Script module or binary module file associated with this manifest.
|
||||
RootModule = 'bin\PSMinIO.dll'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '2025.07.11.1151'
|
||||
|
||||
# Supported PSEditions
|
||||
CompatiblePSEditions = @('Desktop', 'Core')
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
|
||||
|
||||
# Author of this module
|
||||
Author = 'Grace Solutions'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'Grace Solutions'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = '(c) 2025 Grace Solutions. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'A comprehensive PowerShell module for MinIO object storage operations with enterprise-grade features including chunked transfers, advanced object listing, directory management, and performance monitoring. Built on the official Minio .NET SDK.'
|
||||
|
||||
# Minimum version of the PowerShell engine required by this module
|
||||
PowerShellVersion = '5.1'
|
||||
|
||||
# Name of the PowerShell host required by this module
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Minimum version of the PowerShell host required by this module
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
DotNetFrameworkVersion = '4.7.2'
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
CLRVersion = '4.0'
|
||||
|
||||
# Processor architecture (None, X86, Amd64) required by this module
|
||||
# ProcessorArchitecture = ''
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
# RequiredModules = @()
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
RequiredAssemblies = @('bin\PSMinIO.dll', 'bin\Minio.dll')
|
||||
|
||||
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Type files (.ps1xml) to be loaded when importing this module
|
||||
TypesToProcess = @('types\PSMinIO.Types.ps1xml')
|
||||
|
||||
# Format files (.ps1xml) to be loaded when importing this module
|
||||
FormatsToProcess = @('types\PSMinIO.Format.ps1xml')
|
||||
|
||||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
|
||||
# NestedModules = @()
|
||||
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
FunctionsToExport = @()
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = @(
|
||||
'Connect-MinIO',
|
||||
'Get-MinIOBucket',
|
||||
'New-MinIOBucket',
|
||||
'Remove-MinIOBucket',
|
||||
'Test-MinIOBucketExists',
|
||||
'Get-MinIOObject',
|
||||
'New-MinIOObject',
|
||||
'New-MinIOObjectChunked',
|
||||
'New-MinIOFolder',
|
||||
'Get-MinIOObjectContent',
|
||||
'Get-MinIOObjectContentChunked',
|
||||
'Remove-MinIOObject',
|
||||
'Get-MinIOBucketPolicy',
|
||||
'Set-MinIOBucketPolicy',
|
||||
'Get-MinIOStats'
|
||||
)
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = @()
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
||||
# List of all modules packaged with this module
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
FileList = @(
|
||||
'PSMinIO.psd1',
|
||||
'bin\PSMinIO.dll',
|
||||
'bin\Minio.dll',
|
||||
'types\PSMinIO.Types.ps1xml',
|
||||
'types\PSMinIO.Format.ps1xml'
|
||||
)
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
Tags = @('MinIO', 'ObjectStorage', 'S3', 'Cloud', 'Storage', 'Bucket', 'Object', 'Enterprise', 'Chunked', 'Performance', 'Monitoring', 'Automation', 'Backup', 'AWS', 'Compatible')
|
||||
|
||||
# A URL to the license for this module.
|
||||
LicenseUri = 'https://github.com/Grace-Solutions/PSMinIO/blob/main/LICENSE'
|
||||
|
||||
# A URL to the main website for this project.
|
||||
ProjectUri = 'https://github.com/Grace-Solutions/PSMinIO'
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
|
||||
# ReleaseNotes of this module
|
||||
ReleaseNotes = @'
|
||||
## Version 2025.07.11.1151 - Enhanced Release
|
||||
|
||||
### Major Features
|
||||
- Complete Get-MinIOObject cmdlet with advanced filtering, sorting, and pagination
|
||||
- Enhanced directory management with automatic nested structure creation
|
||||
- Advanced chunked operations with configurable chunk sizes and multi-layer progress tracking
|
||||
- Comprehensive timing and performance metrics for all operations
|
||||
- Enterprise-grade automation examples and monitoring capabilities
|
||||
|
||||
### Issues Fixed
|
||||
- Fixed directory creation warnings (now clean verbose logging)
|
||||
- Implemented missing Get-MinIOObject cmdlet with full functionality
|
||||
- Resolved threading and progress reporting issues
|
||||
|
||||
### Documentation and Examples
|
||||
- Updated README.md and comprehensive USAGE.md documentation
|
||||
- Created comprehensive example scripts in scripts/examples/ directory
|
||||
- Added enterprise automation patterns and best practices
|
||||
- Professional logging with no Write-Host usage
|
||||
|
||||
### Technical Improvements
|
||||
- Thread-safe operations for chunked transfers
|
||||
- Enhanced error handling and resource management
|
||||
- Performance optimization with intelligent defaults
|
||||
- Centralized version management system
|
||||
|
||||
This release provides enterprise-grade functionality with professional documentation and comprehensive examples.
|
||||
'@
|
||||
|
||||
# Prerelease string of this module
|
||||
# Prerelease = ''
|
||||
|
||||
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
|
||||
# RequireLicenseAcceptance = $false
|
||||
|
||||
# External dependent modules of this module
|
||||
# ExternalModuleDependencies = @()
|
||||
}
|
||||
}
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
# DefaultCommandPrefix = ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,258 +0,0 @@
|
||||
<?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>
|
||||
<Name>PSMinIO.Models.ChunkedTransferState</Name>
|
||||
<Members>
|
||||
<ScriptProperty>
|
||||
<Name>ProgressFormatted</Name>
|
||||
<GetScriptBlock>
|
||||
return "{0:F1}%" -f $this.ProgressPercentage
|
||||
</GetScriptBlock>
|
||||
</ScriptProperty>
|
||||
<ScriptProperty>
|
||||
<Name>BytesTransferredFormatted</Name>
|
||||
<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>
|
||||
<Name>TotalSizeFormatted</Name>
|
||||
<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>
|
||||
<Name>ChunkSizeFormatted</Name>
|
||||
<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>
|
||||
<Name>ElapsedTime</Name>
|
||||
<GetScriptBlock>
|
||||
if ($this.StartTime -eq $null) { return "Unknown" }
|
||||
$elapsed = [DateTime]::UtcNow - $this.StartTime
|
||||
return $elapsed.ToString("hh\:mm\:ss")
|
||||
</GetScriptBlock>
|
||||
</ScriptProperty>
|
||||
<ScriptProperty>
|
||||
<Name>TransferStatus</Name>
|
||||
<GetScriptBlock>
|
||||
if ($this.IsComplete) {
|
||||
return "Complete"
|
||||
} elseif ($this.CompletedChunkCount -gt 0) {
|
||||
return "In Progress"
|
||||
} else {
|
||||
return "Not Started"
|
||||
}
|
||||
</GetScriptBlock>
|
||||
</ScriptProperty>
|
||||
<ScriptProperty>
|
||||
<Name>RemainingChunks</Name>
|
||||
<GetScriptBlock>
|
||||
return $this.TotalChunks - $this.CompletedChunkCount
|
||||
</GetScriptBlock>
|
||||
</ScriptProperty>
|
||||
</Members>
|
||||
</Type>
|
||||
|
||||
<!-- ChunkInfo Type -->
|
||||
<Type>
|
||||
<Name>PSMinIO.Models.ChunkInfo</Name>
|
||||
<Members>
|
||||
<ScriptProperty>
|
||||
<Name>SizeFormatted</Name>
|
||||
<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>
|
||||
<Name>ChunkRange</Name>
|
||||
<GetScriptBlock>
|
||||
return "{0}-{1}" -f $this.StartByte, $this.EndByte
|
||||
</GetScriptBlock>
|
||||
</ScriptProperty>
|
||||
<ScriptProperty>
|
||||
<Name>Status</Name>
|
||||
<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>
|
||||
Reference in New Issue
Block a user