Chapter4/4.6_AdvancedFunctions/4.6.6_Validattion/ValidateScript.ps1
function Get-DirectorySize { [CmdletBinding()] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias("Path", "PSPath")] [ValidateScript({$_ -match "hoge"})] [string[]]$LiteralPath, [parameter(ValueFromPipelineByPropertyName = $true)] [int]$OverSize ) } |