Stephanevg / PSClassUtils

A set of utilities to work with Powershell Classes
http://powershelldistrict.com/how-to-generate-a-uml-diagram-using-powershell/
91 stars 23 forks source link

New utility: Write-CUInterfaceImplementation #90

Closed IISResetMe closed 5 years ago

IISResetMe commented 5 years ago

Like Write-CUPesterTests, but for auto-generating class implementations for a given interface type:

PS C:\> Write-CUInterfaceImplementation -Name CustomTypeName -InterfaceType ([System.Management.Automation.Language.ITypeName])
class CustomTypeName : System.Management.Automation.Language.ITypeName
{
  [System.String]$FullName
  [System.String]$Name
  [System.String]$AssemblyName
  [System.Boolean]$IsArray
  [System.Boolean]$IsGeneric
  [System.Management.Automation.Language.IScriptExtent]$Extent

  [System.Type]
  GetReflectionType()
  {
    throw 'GetReflectionType not implemented '
  }

  [System.Type]
  GetReflectionAttributeType()
  {
    throw 'GetReflectionAttributeType not implemented '
  }

}
Stephanevg commented 5 years ago

Wow. this is really cool @IISResetMe . thank you SO much for submitting this.

Before I merge it, would you mind rereouting your PR to the dev branch? I would like to add pester tests and some docs before I push it on to master.

Thanks again !! ps: I owe you a beer ;)

IISResetMe commented 5 years ago

@Stephanevg done :)

Stephanevg commented 5 years ago

Awesome. thank you SO SO much for this @IISResetMe . Really!