Last active
February 4, 2017 02:10
-
-
Save Jaykul/01a5342d7d07250401fbe4af8e620d0e to your computer and use it in GitHub Desktop.
Repro case for Type Problem
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
#requires -Module TypeTest | |
using module TypeTest | |
invoke-command { Set-Key $args } -args (Get-Key) -ComputerName . |
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
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