Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Last active February 4, 2017 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaykul/01a5342d7d07250401fbe4af8e620d0e to your computer and use it in GitHub Desktop.
Save Jaykul/01a5342d7d07250401fbe4af8e620d0e to your computer and use it in GitHub Desktop.
Repro case for Type Problem
#requires -Module TypeTest
using module TypeTest
invoke-command { Set-Key $args } -args (Get-Key) -ComputerName .
enum Purpose {
Identity = 1
Permissions = 2
Comments = 4
}
class KeyInfo {
[string]$Name
[Purpose]$Purpose
[string]$RsaKeyXml
}
function Set-Key{
[CmdletBinding()]
param([KeyInfo]$Key)
Write-Host "doing things with your $($key.Name)"
}
function Get-Key{
[CmdletBinding()]
param([KeyInfo]$Key)
[KeyInfo]@{Name = $Env:UserName}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment