Enhancing/fixing existing cmdlets meta-discussion #21089
Replies: 11 comments 20 replies
-
Start-Process + Start-NewProcess = Zoo I think that sooner or later there will come a time, if it hasn't already, when you will have to abandon backward compatibility with Windows PowerShell anyway. Many aspects are already very different. And the old cargo does not provide room for loading new ones. In such conditions it is impossible to create a modern, fast, practical and functional product. |
Beta Was this translation helpful? Give feedback.
-
The PowerShellGet to PSResourceGet module should not be replicated for core PowerShell cmdlets. The issue being described here is and the desire to cutover to a new module and cmdlets is because the current breaking change model does not work. Lets say we do rename the module/cmdlets for one of the core modules. Then two years later there is a redesign or breaking change needed are we going to create yet another module and new cmdlets to fix that? Currently there is no indication to the end user other than reading change log that a specific PowerShell version will break your scripts. If core PowerShell modules were shipped separately on the gallery and adhere to semantic versioning users would be able to stay on older versions and update to adopt breaking chances on their schedule. That is the true fix to this issue of breaking changes and client adoption not band-aiding the issue by migrating to new module/cmdlet names. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Can they can be developed as standalone modules with no PowerShell internal access requirement. |
Beta Was this translation helpful? Give feedback.
-
Herb Sutter has a quite interesting analogy here https://www.youtube.com/watch?v=8U3hl8XMm8c&ab_channel=CppCon regarding making breaking changes and backwards compatible changes in programming languages. The breaking changes have to be far apart and grouped together. But fundamental changes to the core cmdlets should probably be a PowerShell 8 that isn't backwards compatible. |
Beta Was this translation helpful? Give feedback.
-
You should stop developing these modules, make the internal APIs public, publish the existing ones on the Gallery. Empower your community so that it can manage itself. I expect you to focus on the PowerShell engine and stop being distracted by all the community requests which are endless anyway. PS: I'm not asking anyone to agree with this idea, it's just an additional proposal. |
Beta Was this translation helpful? Give feedback.
-
Having new modules that work side-by-side with existing ones, could result the increase in disk footprint? PowerShell is widely used in containers images for CICD pipelines. Smaller base images result in smaller containers, which can improve performance and minimize the deployment time. |
Beta Was this translation helpful? Give feedback.
-
Did the discussion lead to any solutions? Regardless, what do you think about Cmdlet versioning similar to REST API? By "content negotiation" - the creation of the new cmdlet should not be required:
The old "Get-Content" cmdlet could be changed to be optimized to try the filesystem first and handle legacy stuff 'if path given is not a filesystem path'. This could also handle PS5 vs PS7 differences so the new cmdlet features are accessible only when command is used in PS7 or above. By API version indicator for individual cmdlets:
This way, new cmdlets are created but they are hidden from the user and allow for granular upgrades of single functions. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I would feel more comfortable with either a new cmdlet name or an explicit switch parameter for granular API upgrades. With |
Beta Was this translation helpful? Give feedback.
-
Improve (or fix)
|
Beta Was this translation helpful? Give feedback.
-
The Cmdlet WG was discussing some proposed changes to
Start-Process
and it was apparent that there needed to be an overall discussion of how we move cmdlets forward in such a way that:Using PSResourceGet as an example, that set of cmdlets needed to make syntax changes to provide a better and more forward-looking experience than what was designed in PowerShellGet. So the solution was to have a new module with a new name and new cmdlets so that it could be used side-by-side for existing scripts. In addition, there is a compat module available such that you could just have PSResourceGet installed with the compat module and existing scripts would continue to work as they would just be proxy functions that have the older syntax, but actually calls PSResourceGet to perform the work.
In PS7, we have Management and Utility modules that are heavily used such that changes either make them more confusing/complex to use, or we risk breaking existing usage.
The proposal is to have a new
Microsoft.PowerShell.Management
andMicrosoft.PowerShell.Utility
modules that would work side-by-side with existing ones, but allows the community and the team to evolve the cmdlets over time. Naming of these modules is up for discussion. Naming of the new cmdlets are also up for discussion.For example, we could have a
Microsoft.PowerShell.SystemManagement
module with aStart-NewProcess
cmdlet. This would also allow FileSystem preferred versions of the navigation cmdlets:Get-FileContent
which could still fallback to using PowerShell providers if the path given is not a filesystem path, but can be optimized to try the filesystem first.Invoke-RestMethod
could be split into separate cmdlets:Set-RestApi
(might need a better noun here).,Get-RestApi
, etc...Beta Was this translation helpful? Give feedback.
All reactions