Author Posts

August 31, 2017 at 4:00 am

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 " 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)?

August 31, 2017 at 7:57 am

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[2], 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.

t*6f%YEcw#CPJb)2a3H_?$~ejDdK{VBLp ZQ=x9]nG5vUo}lku

August 31, 2017 at 2:20 pm

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.