Major project reorganization: Centralized version management and improved structure

- Reorganized project structure with proper directory separation:
  * All scripts moved to scripts/ directory (including examples)
  * All documentation moved to docs/ directory (except README.md)
  * Centralized version management in Version.ps1

- Implemented centralized version management system:
  * Version.ps1 provides single source of truth for version information
  * Automatic yyyy.MM.dd.HHmm versioning based on build time
  * scripts/Update-Version.ps1 updates all version references
  * src/Properties/AssemblyInfo.cs for assembly version information

- Enhanced build system:
  * scripts/Build.ps1 - Full build with validation and packaging
  * scripts/Quick-Build.ps1 - Fast build handling file locking issues
  * Removed automatic copy from project file to avoid locking
  * Integrated version updates into build process

- Updated PowerShell Gallery publishing:
  * scripts/Publish-PSMinIOToGallery.ps1 updated for new structure
  * docs/POWERSHELL-GALLERY-RELEASE.md comprehensive publishing guide
  * Module manifest updated with proper metadata and release notes

- Updated all documentation and examples:
  * README.md updated with PowerShell Gallery installation
  * All example scripts updated with correct import paths
  * scripts/examples/README.md updated for new location
  * docs/PROJECT-STRUCTURE.md documents new organization

- Version updated to 2025.07.11.1151 with centralized management
- All import paths corrected for new structure
- Professional project organization following PowerShell best practices
This commit is contained in:
PSMinIO Developer
2025-07-11 11:53:08 -04:00
parent 677fa8c172
commit 90c64d3237
24 changed files with 1704 additions and 64 deletions
+188
View File
@@ -0,0 +1,188 @@
# PowerShell Gallery Release Guide for PSMinIO
This guide walks you through publishing PSMinIO to the PowerShell Gallery.
## Prerequisites
### 1. PowerShell Gallery Account
- Create an account at [PowerShell Gallery](https://www.powershellgallery.com/)
- Generate an API key from your account settings
- Keep your API key secure and never commit it to source control
### 2. Required PowerShell Modules
```powershell
# Install required modules if not already present
Install-Module -Name PowerShellGet -Force -AllowClobber
Install-Module -Name PackageManagement -Force -AllowClobber
```
### 3. Verify Module Build
Ensure the module has been built and all files are present:
```powershell
# Build the module (if needed)
dotnet build PSMinIO.csproj --configuration Release
# Verify module structure
Get-ChildItem .\Module\PSMinIO\ -Recurse
```
## Pre-Release Checklist
### ✅ Module Validation
- [ ] Module manifest (PSMinIO.psd1) is valid
- [ ] All required assemblies are present (PSMinIO.dll, Minio.dll)
- [ ] Type and format files are included
- [ ] Version number follows semantic versioning (2.0.0)
- [ ] Release notes are comprehensive and accurate
- [ ] All cmdlets are properly exported
### ✅ Documentation
- [ ] README.md is updated with latest features
- [ ] USAGE.md includes comprehensive examples
- [ ] Examples directory contains working scripts
- [ ] Release notes document all changes
- [ ] License file is present and correct
### ✅ Testing
- [ ] Module imports without errors
- [ ] All exported cmdlets are available
- [ ] Basic functionality tests pass
- [ ] Examples run successfully
- [ ] No Write-Host usage in production code
### ✅ Repository
- [ ] All changes are committed to Git
- [ ] Repository is pushed to GitHub
- [ ] Tags are created for the release
- [ ] GitHub release is created (optional but recommended)
## Release Process
### Step 1: Validate Everything
Run the automated validation:
```powershell
# Test the release process without actually publishing
.\Publish-PSMinIOToGallery.ps1 -WhatIf
```
### Step 2: Publish to PowerShell Gallery
```powershell
# Publish with your API key
.\Publish-PSMinIOToGallery.ps1 -NuGetApiKey "YOUR_API_KEY_HERE"
# Or let the script prompt for the API key securely
.\Publish-PSMinIOToGallery.ps1
```
### Step 3: Verify Publication
1. Check the PowerShell Gallery: https://www.powershellgallery.com/packages/PSMinIO
2. Test installation from the gallery:
```powershell
Install-Module -Name PSMinIO -Force
Import-Module PSMinIO
Get-Command -Module PSMinIO
```
## Post-Release Tasks
### 1. Update Documentation
- [ ] Update README.md with installation instructions from PowerShell Gallery
- [ ] Add PowerShell Gallery badge to README
- [ ] Update any version references in documentation
### 2. GitHub Release
Create a GitHub release with:
- [ ] Tag matching the module version (v2.0.0)
- [ ] Release title: "PSMinIO v2.0.0 - Major Enhancement Release"
- [ ] Copy release notes from the module manifest
- [ ] Attach any relevant assets
### 3. Announce the Release
- [ ] Update project documentation
- [ ] Notify users through appropriate channels
- [ ] Consider creating a blog post or announcement
## Troubleshooting
### Common Issues
#### 1. Module Validation Errors
```powershell
# Check manifest syntax
Test-ModuleManifest -Path .\Module\PSMinIO\PSMinIO.psd1
```
#### 2. Missing Dependencies
Ensure all required files are in the module directory:
- `bin\PSMinIO.dll`
- `bin\Minio.dll`
- `types\PSMinIO.Types.ps1xml`
- `types\PSMinIO.Format.ps1xml`
#### 3. API Key Issues
- Verify your API key is correct
- Check that your PowerShell Gallery account has publishing permissions
- Ensure the API key hasn't expired
#### 4. Version Conflicts
If the version already exists:
- Increment the version number in PSMinIO.psd1
- Rebuild the module
- Commit and push changes
### Getting Help
#### PowerShell Gallery Support
- Documentation: https://docs.microsoft.com/en-us/powershell/gallery/
- Issues: https://github.com/PowerShell/PowerShellGallery/issues
#### Module-Specific Issues
- Check the validation output from the publish script
- Review the module manifest for syntax errors
- Ensure all dependencies are properly referenced
## Security Considerations
### API Key Management
- Never commit API keys to source control
- Use environment variables or secure prompts
- Rotate API keys regularly
- Limit API key permissions to publishing only
### Module Security
- All assemblies are signed and from trusted sources
- No malicious code or backdoors
- Dependencies are from official NuGet packages
- Code has been reviewed for security issues
## Version Management
### Semantic Versioning
PSMinIO follows semantic versioning (MAJOR.MINOR.PATCH):
- **MAJOR**: Breaking changes
- **MINOR**: New features, backward compatible
- **PATCH**: Bug fixes, backward compatible
### Current Release: v2.0.0
This is a major release with significant new features and improvements:
- Complete Get-MinIOObject implementation
- Enhanced directory management
- Advanced chunked operations
- Comprehensive documentation and examples
### Next Release Planning
Future releases will follow the same process:
1. Increment version number appropriately
2. Update release notes
3. Follow this release guide
4. Publish to PowerShell Gallery
## Success Metrics
After release, monitor:
- [ ] Download statistics on PowerShell Gallery
- [ ] User feedback and issues
- [ ] GitHub stars and forks
- [ ] Community adoption and usage
The PSMinIO module is now ready for enterprise use with professional-grade functionality and comprehensive documentation!
+212
View File
@@ -0,0 +1,212 @@
# PSMinIO Project Structure
This document describes the reorganized project structure and centralized version management system.
## Directory Structure
```
PSMinIO/
├── README.md # Main project documentation
├── LICENSE # Project license
├── PSMinIO.csproj # Main project file
├── Version.ps1 # Centralized version configuration
├── src/ # Source code
│ ├── Properties/
│ │ └── AssemblyInfo.cs # Assembly version information
│ ├── Cmdlets/ # PowerShell cmdlet implementations
│ ├── Models/ # Data models and result objects
│ └── Utils/ # Utility classes and helpers
├── Module/ # Built module directory
│ └── PSMinIO/
│ ├── PSMinIO.psd1 # Module manifest
│ ├── bin/ # Compiled assemblies
│ └── types/ # PowerShell type and format files
├── scripts/ # All PowerShell scripts
│ ├── Build.ps1 # Main build script
│ ├── Quick-Build.ps1 # Quick build without file locking issues
│ ├── Update-Version.ps1 # Version update script
│ ├── Publish-PSMinIOToGallery.ps1 # PowerShell Gallery publishing
│ └── examples/ # Usage examples
│ ├── README.md # Examples documentation
│ ├── 01-Basic-Operations.ps1
│ ├── 02-Advanced-Object-Listing.ps1
│ ├── 03-Directory-Management.ps1
│ ├── 04-Chunked-Operations.ps1
│ ├── 05-Bulk-Operations.ps1
│ └── 06-Enterprise-Automation.ps1
├── docs/ # Documentation
│ ├── USAGE.md # Comprehensive usage guide
│ ├── RELEASE-NOTES.md # Release notes
│ ├── POWERSHELL-GALLERY-RELEASE.md # Gallery release guide
│ └── PROJECT-STRUCTURE.md # This file
├── Artifacts/ # Build artifacts
├── Publish/ # Publishing staging area
└── bin/ # Build output
```
## Version Management System
### Centralized Version Configuration
The project uses a centralized version management system based on `Version.ps1`:
- **Version Format**: `yyyy.MM.dd.HHmm` (e.g., `2025.07.11.1151`)
- **Automatic Generation**: Version is generated based on current date/time
- **Centralized Updates**: Single script updates all version references
### Version Files
1. **Version.ps1** - Master version configuration
2. **src/Properties/AssemblyInfo.cs** - Assembly version information
3. **Module/PSMinIO/PSMinIO.psd1** - PowerShell module manifest
### Version Update Process
```powershell
# Update all version information
.\scripts\Update-Version.ps1
# Build with updated version
.\scripts\Quick-Build.ps1
```
## Build System
### Build Scripts
1. **scripts/Build.ps1** - Full build with validation and packaging
2. **scripts/Quick-Build.ps1** - Fast build for development (handles file locking)
3. **scripts/Update-Version.ps1** - Version management
### Build Process
1. Update version information across all files
2. Clean previous build artifacts
3. Compile .NET project
4. Copy assemblies to module directory
5. Validate module manifest
6. Optional: Run tests and create packages
### Handling File Locking
The Quick-Build script handles PowerShell file locking issues:
- Removes automatic copy from project file
- Manual copy with retry logic
- Graceful handling of locked files
## Scripts Organization
### Location
All scripts are now in the `scripts/` directory:
- Build and deployment scripts in `scripts/`
- Usage examples in `scripts/examples/`
### Import Paths
Example scripts use relative imports:
```powershell
Import-Module ..\..\Module\PSMinIO\PSMinIO.psd1
```
## Documentation Structure
### Location
All documentation is in the `docs/` directory except README.md:
- `README.md` - Main project overview (root directory)
- `docs/USAGE.md` - Comprehensive usage guide
- `docs/RELEASE-NOTES.md` - Version history and changes
- `docs/POWERSHELL-GALLERY-RELEASE.md` - Publishing guide
- `docs/PROJECT-STRUCTURE.md` - This structure guide
### Content Organization
- **README.md**: Overview, installation, quick start
- **USAGE.md**: Detailed usage patterns and examples
- **Examples**: Practical scripts for common scenarios
- **Release Notes**: Version history and changes
## Development Workflow
### 1. Making Changes
```powershell
# Make code changes in src/
# Update documentation if needed
```
### 2. Building
```powershell
# Quick build for testing
.\scripts\Quick-Build.ps1
# Full build with validation
.\scripts\Build.ps1
```
### 3. Testing
```powershell
# Import and test module
Import-Module .\Module\PSMinIO\PSMinIO.psd1
# Run example scripts
.\scripts\examples\01-Basic-Operations.ps1
```
### 4. Committing
```powershell
# Version is automatically updated during build
git add .
git commit -m "Description of changes"
git push
```
### 5. Publishing
```powershell
# Publish to PowerShell Gallery
.\scripts\Publish-PSMinIOToGallery.ps1
```
## Key Benefits
### Centralized Version Management
- Single source of truth for version information
- Automatic timestamp-based versioning
- Consistent version across all files
### Organized Structure
- Clear separation of concerns
- All scripts in dedicated directory
- Documentation properly organized
### Improved Build Process
- Handles file locking issues
- Automatic version updates
- Validation and testing integration
### Professional Documentation
- Comprehensive usage examples
- Clear project structure
- Publishing guidelines
## Migration Notes
### From Previous Structure
- Examples moved from `examples/` to `scripts/examples/`
- Documentation moved to `docs/` (except README.md)
- Version management centralized in `Version.ps1`
- Build process improved with Quick-Build option
### Import Path Updates
All example scripts updated to use:
```powershell
Import-Module ..\..\Module\PSMinIO\PSMinIO.psd1
```
### Version Format Change
- Previous: Manual semantic versioning
- Current: Automatic date-based versioning (yyyy.MM.dd.HHmm)
- PowerShell Gallery: Uses semantic version for compatibility
This structure provides a professional, maintainable, and scalable foundation for the PSMinIO project.
+130
View File
@@ -0,0 +1,130 @@
# PSMinIO Release Notes
## Version 2.0.0 - Major Enhancement Release
### 🎉 Major Features Added
#### ✅ Complete Get-MinIOObject Cmdlet Implementation
- **Advanced Filtering**: Filter by prefix, exact object name, or exclude directories
- **Multi-Criteria Sorting**: Sort by Name, Size, LastModified, or ETag (ascending/descending)
- **Result Pagination**: Limit results with MaxObjects parameter
- **Version Support**: Include object versions for versioned buckets
- **Recursive Control**: Toggle recursive vs non-recursive listing
#### ✅ Enhanced Directory Management
- **Automatic Directory Creation**: BucketDirectory parameter creates nested structures automatically
- **Explicit Folder Creation**: New-MinIOFolder cmdlet for creating folder hierarchies
- **Clean Directory Handling**: Non-critical directory creation with graceful fallback
- **Multi-Level Support**: Support for complex nested directory structures (e.g., `company/departments/engineering/teams/backend`)
#### ✅ Advanced Chunked Operations
- **Configurable Chunk Sizes**: 1MB minimum with intelligent size recommendations
- **Multi-Layer Progress Tracking**: Collection → File → Chunk progress reporting
- **Performance Optimization**: Optimal chunk sizes for different file sizes and network conditions
- **Resume Capability Foundation**: Infrastructure for future resume functionality
#### ✅ Comprehensive Timing and Performance Metrics
- **Duration Tracking**: Precise timing for all upload/download operations
- **Speed Reporting**: Intelligent formatting (B/s, KB/s, MB/s, GB/s, TB/s)
- **Performance Comparison**: Built-in tools for comparing regular vs chunked operations
- **Transfer Statistics**: Detailed metrics for monitoring and optimization
### 🛠️ Issues Fixed
#### ✅ Directory Creation Warnings
- **Before**: Disruptive `WARNING:` messages about "ObjectSize must be set"
- **After**: Clean `VERBOSE:` messages labeled as "Directory creation failed (non-critical)"
- **Impact**: Professional, clean logging that doesn't alarm users
#### ✅ Missing Get-MinIOObject Cmdlet
- **Before**: Cmdlet referenced in documentation but didn't exist
- **After**: Full implementation with enterprise-grade filtering and sorting capabilities
- **Impact**: Complete object discovery and management functionality
#### ✅ Threading and Progress Issues
- **Fixed**: PowerShell method calls from background threads
- **Fixed**: Array size limits for chunk generation
- **Fixed**: Progress reporting synchronization issues
### 📚 Documentation and Examples
#### ✅ Enhanced Documentation
- **Updated README.md**: Modern feature descriptions with comprehensive overview
- **Enhanced USAGE.md**: Advanced patterns, chunked operations, and enterprise scenarios
- **Professional Presentation**: Clean formatting and structured information
#### ✅ Comprehensive Examples Directory
Created 6 detailed example scripts with no `Write-Host` usage:
1. **01-Basic-Operations.ps1**: Fundamental operations for beginners
2. **02-Advanced-Object-Listing.ps1**: Filtering, sorting, and pagination demonstrations
3. **03-Directory-Management.ps1**: Nested directory structures and organization patterns
4. **04-Chunked-Operations.ps1**: Large file handling with performance optimization
5. **05-Bulk-Operations.ps1**: Batch processing and automation workflows
6. **06-Enterprise-Automation.ps1**: Enterprise monitoring, reporting, and compliance
#### ✅ Examples Features
- **Real-World Scenarios**: Practical examples for common use cases
- **Best Practices**: Proper error handling, resource cleanup, and logging
- **Performance Guidelines**: Chunk size recommendations and optimization tips
- **Enterprise Patterns**: Monitoring, auditing, and automation workflows
### 🏗️ Technical Improvements
#### ✅ Code Quality Enhancements
- **Thread Safety**: Improved thread-safe operations for chunked transfers
- **Error Handling**: Comprehensive error handling with graceful degradation
- **Resource Management**: Proper cleanup and disposal patterns
- **Performance**: Optimized operations with intelligent defaults
#### ✅ New Utility Classes
- **ThreadSafeProgressCollector**: Synchronized progress reporting
- **ThreadSafeResultCollector**: Thread-safe result aggregation
- **ThreadSafeChunkedProgressReporter**: Multi-layer progress tracking
- **MinIODownloadResult**: Enhanced download result information
### 🧹 Repository Cleanup
- **Removed**: All temporary test files and debugging scripts
- **Cleaned**: Temporary dependency packages and build artifacts
- **Organized**: Proper directory structure with examples and documentation
- **Standardized**: Consistent file naming and organization
### 🎯 Key Benefits
#### For Developers
- **Complete Functionality**: All documented features now implemented
- **Professional Logging**: Clean, informative output without unnecessary warnings
- **Rich Examples**: Comprehensive examples for every use case
- **Performance Insights**: Built-in timing and speed metrics
#### For Enterprise Users
- **Monitoring Capabilities**: Built-in statistics and health checking
- **Automation Ready**: Enterprise-grade automation examples
- **Compliance Support**: Security auditing and policy management examples
- **Scalability**: Chunked operations for large-scale data transfers
#### For Operations Teams
- **Clean Logging**: Professional verbose output without disruptive warnings
- **Performance Monitoring**: Built-in metrics for transfer optimization
- **Automation Examples**: Ready-to-use enterprise automation patterns
- **Comprehensive Documentation**: Detailed usage guides and best practices
### 🚀 Upgrade Path
This is a major enhancement release that maintains backward compatibility while adding significant new functionality. Existing scripts will continue to work, with the added benefit of:
- Enhanced performance metrics
- Cleaner logging output
- Access to new Get-MinIOObject functionality
- Improved chunked operations
### 📋 Next Steps
Users can now:
1. **Explore Examples**: Run the comprehensive example scripts
2. **Implement Advanced Filtering**: Use the new Get-MinIOObject capabilities
3. **Optimize Large Transfers**: Leverage chunked operations with performance metrics
4. **Build Enterprise Automation**: Use the enterprise automation patterns
5. **Monitor Performance**: Utilize built-in timing and speed reporting
This release represents a significant maturation of the PSMinIO module, providing enterprise-grade functionality with professional documentation and comprehensive examples.