Skip to content

Instantly share code, notes, and snippets.

@dlwyatt
Created December 26, 2014 01:22
Show Gist options
  • Save dlwyatt/553538180ed36c434fd5 to your computer and use it in GitHub Desktop.
Save dlwyatt/553538180ed36c434fd5 to your computer and use it in GitHub Desktop.
PSD1 import ugliness
$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