Created
December 26, 2014 01:22
-
-
Save dlwyatt/553538180ed36c434fd5 to your computer and use it in GitHub Desktop.
PSD1 import ugliness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$utilsType = [scriptblock].Assembly.GetType('System.Management.Automation.PsUtils') | |
$flags = [System.Reflection.BindingFlags]'Instance, Static, Nonpublic' | |
$method = $utilsType.GetMethod('EvaluatePowerShellDataFileAsModuleManifest', $flags) | |
$context = $ExecutionContext.GetType().GetField('_context', $flags).GetValue($ExecutionContext) | |
$path = (gmo bitstransfer -list).Path | |
$hashTable = $method.Invoke($null, @($null, $path, $context, $true)) | |
$hashTable | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment