I’m trying to determine the easiest way to find out the built-in ConfirmImpact level of cmdlets (Ex: Restart-Computer, Remove-, Set-, etc…). I found the first article below that says the first step “…is to determine the full path of the .dll that contains the cmdlet for which we need to know the ConfirmImpact parameter.”. The article shows you how to do that via the Get-Command cmdlet. Then it mentions one of a few tools, such as ildasm.exe, that can be used to pull out the information. From what I’m reading, ildasm.exe is free and is part of Visual Studio and also at least the Windows 7 SDK (I’m guessing it’s also part of the Windows 10 SDK). Is there a better way to do this? If not, what is the bare minimum (i.e. the least amount of hard drive space taken) I’d need to install for Visual Studio or the Windows 10 SDK (Assuming the ildasm.exe is part of it)?
I found the answer to my question. The part of the code at the below blog that deals with the cmdlets seems to work well. However, the part that deals with determining the impact for functions can return incorrect information if the location (Ex: The line the ConfirmImpact piece is on is actually in $c, as was the case in a function I wrote) and/or formatting of the ConfirmImpact piece (Ex: ConfirmImpact=‘High’ VS ConfirmImpact=“High”) is different than what his code is expecting.
Not sure how the URL got changed/warped in that last post and why I can’t edit my post, but here it is again.