ETidalgo
9/26/2018 - 6:51 PM

Dlls and the command line

[Use PowerShell to Interact with the Windows API: Part 1 – Hey, Scripting Guy! Blog] (https://blogs.technet.microsoft.com/heyscriptingguy/2013/06/25/use-powershell-to-interact-with-the-windows-api-part-1/) [Using Powershell and Reflection API to Invoke Methods from .NET Assemblies] (https://blog.netspi.com/using-powershell-and-reflection-api-to-invoke-methods-from-net-assemblies/) [How to use .Net code in PowerShell (C# and DLL integration)] (http://activedirectoryfaq.com/2016/01/use-net-code-c-and-dlls-in-powershell/)

## Note these are adapted steps but this didn't work for this dll

[Reflection.Assembly]::LoadFile("D:\dev\bin\Debug\tests.dll")
[SystemTests.HereNotThere]::RunASpecificTest()

## Might work
$htypes = [Reflection.Assembly]::LoadFile("C:\Users\[user]\.nuget\packages\humanizer.core\2.2.0\lib\netstandard1.0\Humanizer.dll")
$htypes.GetTypes() | select Name, Namespace | sort Namespace | ft -groupby Namespace 

## https://github.com/dfinke/PowerShellHumanizer/blob/master/PowerShellHumanizer.psm1
Add-Type -Path "$PSScriptRoot\humanizer.dll"
$Types = @("$PSScriptRoot\String.types.ps1xml", 
    "$PSScriptRoot\Int.types.ps1xml", 
    "$PSScriptRoot\TimeSpan.types.ps1xml",
    "$PSScriptRoot\DateTime.types.ps1xml",
    "$PSScriptRoot\CmdletInfo.types.ps1xml")
    
[Humanizer.InflectorExtensions]::Singularize($word)
[Humanizer.InflectorExtensions]::Dasherize($TitleString.Underscore())
[Humanizer.InflectorExtensions]::Pluralize("")