Skip to content

Instantly share code, notes, and snippets.

@aetos382
Last active August 29, 2015 14:01
Show Gist options
  • Save aetos382/01c3215ce91552eef6e9 to your computer and use it in GitHub Desktop.
Save aetos382/01c3215ce91552eef6e9 to your computer and use it in GitHub Desktop.
function Outer-Func {
function Inner-Func {
param ($x)
"Inner-Func called: $x"
}
Inner-Func 1 #ここからは呼べる
}
Outer-Func
Inner-Func 2 # ここからは呼べない
function New-Person {
param(
[Parameter(Mandatory)]
[string] $Name,
[Parameter(Mandatory)]
[ValidateRange(0, 100)]
[int] $Age,
[Parameter(Mandatory)]
[ValidateSet('Male', 'Female')]
[string] $Gender)
[PSCustomObject] @{
Name = $Name;
Age = $Age;
Gender = $Gender;
}
}
$people = @(
(New-Person 太郎 28 Male),
(New-Person 花子 24 Female),
(New-Person リチャード 41 Male),
(New-Person メリル 19 Female)
)
$people = @(
@{ Name = '太郎'; Age = 28; Gender = 'Male'; },
@{ Name = '花子'; Age = 24; Gender = 'Female'; },
@{ Neme = 'リチャード'; Age = 41; Gender = 'Male'; },
@{ Name = 'メリル'; Age = 19; Gender = 'Femare'; }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment