Deprecation of cmdlets

Monday, April 30, 2012

Until PowerShell 3.0, if you shipped a cmdlet there was no good way to deprecate it. Cmdlet developers can use the .NET ObsoleteAttribute now to let users know that they should not use a cmdlet anymore. In the following example, the cmdlet can run but it will issue a warning that another cmdlet should be used from now on. This gives the user time to prepare for the change and fix any scripts dependent on old commands. $code = @' using System; using System.Management.Automation; namespace ObsoleteCmdlet { ...