{"id":17726,"date":"2007-05-14T07:35:19","date_gmt":"2007-05-14T15:35:19","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=17726"},"modified":"2019-05-20T07:47:37","modified_gmt":"2019-05-20T15:47:37","slug":"rfc-deprecating-parameters","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/rfc-deprecating-parameters\/","title":{"rendered":"RFC: Deprecating Parameters"},"content":{"rendered":"<h2>Request For Comment\n<\/h2>\n<p>One of our partners asked what the guidance was for a product that releases a cmdlet and then decides that they need to deprecate one or more of the parameters in a future release.  We don&#8217;t currently have guidance on this topic so I thought I would tell you what we were thinking of saying and then you can comment about whether that is reasonable or not.\n<\/p>\n<h2>Background\n<\/h2>\n<p>The problem is that a bunch of scripts might have been written to use that parameter so if they just drop the parameter in the next release, it will break those scripts. \n<\/p>\n<p>It&#8217;s easy to say, &#8220;never drop a parameter&#8221; but that isn&#8217;t realistic.  Things change and teams need the flexibility to adapt.  \n<\/p>\n<h2>Proposed Guidance\n<\/h2>\n<p>Avoid dropping parameters whenever possible since doing may break customer scripts.\n<\/p>\n<p>If you must drop a parameter, do so over the course of a couple of releases.  Depreciate it in the next release and then drop it in the release after that. \n<\/p>\n<p>Deprecate the parameter by:\n<\/p>\n<ol>\n<li>Documenting this in your release notes.\n<\/li>\n<li>Add this information to the HELP content for this cmdlet. Put a note under the NOTES section and in the PARAMETER details section.\n<\/li>\n<li>Modify the implementation of the CMDLET to issue a message on the WARNING channel (WriteWarning()) when the deprecated parameter is used.\n<\/li>\n<\/ol>\n<p>Validate that all the data binding scenarios (pipelining) scenarios continue to work property after dropping the parameters.\n<\/p>\n<h2>Note\n<\/h2>\n<p>One possibility is for PowerShell to provide explicit support for this scenario. We could create a DEPECREATED stream and have a DEPRECATED attribute that you could put on your parameters and then we could change the engine to look for this and issue a standardized error message.  In the end, this would consume a lot of pm\/dev\/test calories for a scenario that I really hope doesn&#8217;t happens.   I&#8217;d rather spend those calories on some amazing remoting capabilities so I&#8217;m strongly disinclined to go down that path.  \n<\/p>\n<p>What do you think?\n<\/p>\n<p>Jeffrey Snover [MSFT]<br\/>Windows Management Partner Architect<br\/>Visit the Windows PowerShell Team blog at:    <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a><br\/>Visit the Windows PowerShell ScriptCenter at:  <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a>\n\t<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Request For Comment One of our partners asked what the guidance was for a product that releases a cmdlet and then decides that they need to deprecate one or more of the parameters in a future release. We don&#8217;t currently have guidance on this topic so I thought I would tell you what we were [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17726","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Request For Comment One of our partners asked what the guidance was for a product that releases a cmdlet and then decides that they need to deprecate one or more of the parameters in a future release. We don&#8217;t currently have guidance on this topic so I thought I would tell you what we were [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=17726"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17726\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=17726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=17726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=17726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}