Add back Get-HotFix cmdlet#10740
Conversation
src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
Show resolved
Hide resolved
|
Should this just re-written over MMI / CIM APIs, seems simple enough? It would be like: [cimsession]::Create('localhost').QueryInstances("root/cimv2", 'WQL', 'select * from Win32_QuickFixEngineering')or [cimsession]::Create('localhost').QueryInstances("root/cimv2", 'WQL', 'select * from Win32_QuickFixEngineering where hotfixid="KB4514359"') |
|
@adityapatwardhan doesn't seem to provide much benefit to rewrite. We could have rewrote it in PS6 timeframe as it would have made sense then. |
src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1
Show resolved
Hide resolved
|
Tiny Codacy issue in new code should be fixed. Btw, is there info on when (approximately:year/PSVersion) Get-HotFix was removed? |
|
@anmenaga |
| "Get-TimeZone", | ||
| "Set-TimeZone") | ||
| "Set-TimeZone", | ||
| "Get-HotFix") |
There was a problem hiding this comment.
Minor nit: For a cleaner history, it would've been be nice if parentheses/commas were placed in such a way that the last line does not require any change for the next addition (i.e. have the closing parenthesis in this case on the next line).
| // catch (ArgumentException) // thrown (indirectly) by SecurityIdentifier.constr (on XP only?) | ||
| // { catch not needed - this is already caught as SystemException | ||
| // } | ||
| // catch (PlatformNotSupportedException) // thrown (indirectly) by SecurityIdentifier.Translate (on Win95 only?) |
There was a problem hiding this comment.
Wow, was powershell v1 supported on win95 (I though PS came out only around the XP times)? Or is this still from Monad days?
There was a problem hiding this comment.
Not sure if v1 actually supported 95, although I suspect not. This error seems like a developer trying to cover their bases for exceptions.
|
@SteveL-MSFT Out of interest: Is there a list of issues or tags for low hanging fruits of cmdlets that can now be brought back relatively easily with .Net Core 3? |
|
@bergmeister probably this one at least for Utility module: #2123, there's a few open issues on specific cmdlets. I already have a PR open for Clipboard cmdlets. |
|
Updated comment there #2123 (comment) |
|
Also DefaultCommands.Tests.ps1 is good source. |
|
🎉 Handy links: |
PR Summary
Re-enable
Get-HotFixcmdlet on Windows. Since the WmiHelper class relies on WMI cmdlets, rewrote the code a bit to not use it. Added tests that depend on Win32_QuickFixEngineering WMI class returning results. Removed a bunch of referenced namespaces in the original source file that aren't needed as well as an old comment.PR Context
Fix #2296
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.Get-HotFixdocumentation back for PS7 MicrosoftDocs/PowerShell-Docs#4908