DiD you know : You can find the assembly that contains a particular cmdlet

POSH TIP: Find .Net assembly Name that implements a particular cmdlet

Use the Get-Command cmdlet along with the name of the target cmdlet for getting the implementing assembly like below..

(Get-Command -name Get-Process).DLL

Put the get-command along with name parameter within parenthesis and then use the ‘DLL’ property

The DLL property returns the assembly that actually contains the implementation of the cmdlet.

C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad364e35
\Microsoft.PowerShell.Commands.Management.dll

Advertisements

Powershell Nugget : DSC ISE Snippet

One of cmdlet available within Powershell ISE is New-ISESnippet. This snippet allows us to add new code snippets to the ISE environment which can be used later at multiple places thereby saving overall development time as well as ensuring standards.

Desired State configuration provides a new snippet called “DSC Resource Provider”

On the Script tab of Powershell ISE, Press “Control + J”. A suggestion box appears containing all the registered Powershell snippets on the machine. Alternatively, you can also click on Edit menu and then “Start Snippets” sub-menu item to get the same suggestion box.

pn-01

You can go to “DSC resource provider” and click on it. It provides a templates for creating custom resources. It provides the template for all the three functions namely: Get-TargetResource, Set-TargetResource and Test-TargetResource.

pn-02

Makes life a bit easier by not remembering the name of the mandatory DSC functions.

Cheers!