PowerShell.MCP v1.3.8 - Visual -WhatIf Preview for Remove-LinesFromFile & Safety Improvements #22
yotsuda
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Visual -WhatIf Preview for Remove-LinesFromFile & Safety Improvements
This release adds visual diff preview to
Remove-LinesFromFile, safer deletion handling forUpdate-LinesInFile, newline validation across all pattern-matching cmdlets, and performance improvements toUpdate-MatchInFile.✨ What's New
🔍 Visual -WhatIf Preview for Remove-LinesFromFile
Remove-LinesFromFile -WhatIfnow displays a detailed preview showing exactly which lines will be deleted:⚡ Performance: Update-MatchInFile Single-Pass Processing
Update-MatchInFilehas been refactored from 2-pass to 1-pass processing, reading the file only once instead of twice. This improves performance especially for large files.🛡️ Safer Deletion Handling for Update-LinesInFile
Update-LinesInFilenow requires-Contentparameter when-LineRangeis specified:This prevents accidental line deletion when
-Contentis forgotten.🚫 Newline Validation for Pattern Parameters
All cmdlets with
-Patternor-Containsparameters now reject newline characters:📊 What's Changed Since v1.3.7
New Features
Visual -WhatIf Preview:
Remove-LinesFromFile -WhatIfshows lines to be deleted in redPipeline Input Support:
Add-LinesToFile -Contentnow accepts pipeline inputUpdate-LinesInFile -Contentnow accepts pipeline inputImprovements
Performance:
Update-MatchInFilerefactored from 2-pass to 1-pass processing (reads file once instead of twice)Display:
Update-MatchInFilenormal execution now shows only replacement text (green), while-WhatIfshows both before (red) and after (green)Safety:
Update-LinesInFilenow requires-Contentwhen-LineRangeis specifiedShow-TextFile,Update-MatchInFile,Remove-LinesFromFileBug Fixes:
Add-LinesToFilenow displays actual insertion line number in summary messageCode Quality
🔧 Technical Details
Newline Validation
Update-LinesInFile Content Behavior
-Contentomitted-Content @()-Content "text"-Content ""📄 Installation & Upgrade
Update MCP Configuration
(Get-Module PowerShell.MCP).ModuleBase{ "mcpServers": { "PowerShell": { "command": "C:\\Users\\YourName\\Documents\\PowerShell\\Modules\\PowerShell.MCP\\1.3.8\\bin\\PowerShell.MCP.Proxy.exe" } } }Note: Adjust path as needed for your environment.
📖 Full Guide: https://github.com/yotsuda/PowerShell.MCP#quick-start
Full Documentation: https://github.com/yotsuda/PowerShell.MCP
Questions? GitHub Discussions
Report Issues: GitHub Issues
⚠ Security Notice: Provides complete PowerShell access. Use in trusted environments only.
This discussion was created from the release PowerShell.MCP v1.3.8 - Visual -WhatIf Preview for Remove-LinesFromFile & Safety Improvements.
Beta Was this translation helpful? Give feedback.
All reactions