1

It is possible decode (or show what to do) command Powershell?

I try use command connect-msolservice, but i get exceptions:

enter image description here.

So maybe if I get content command, i can configure system to this connection.

2 Answers 2

5

Yes, you can use ILSpy to decode powershell dll. Download ILSpy. For find path .dll with your cmdlets, use powershell command:

Get-Command connect-msolservice | fl DLL,ImplementingType

Sign up to request clarification or add additional context in comments.

Comments

3

Or you can use a native solution to view the Metadata of the builtin (or any other cmdlets)

$Metadata = New-Object System.Management.Automation.CommandMetaData (Get-Command Connect-MSOLService)
$Contents = [System.Management.Automation.ProxyCommand]::Create($Metadata) 

credit to http://windowsitpro.com/blog/powershell-proxy-functions

2 Comments

Looks useful for getting information in the interface (I use the word hesitatingly) to a cmdlet, but I guess that creating a ProxyCommand based on the command metadata is more like reverse-engineering the cmdlet than actually revealing what it does?
It allows you to add functionality as the proxy function wraps the original command let. I use it to proxy all the write-host, write-warning, write-error etc. cmdlets to add a -log $logfile parameter this makes logging boilerplate less intrusive in the code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.