Powershell小技巧之使用Update TypeData扩展类型系统
脚本 Update-TypeData -TypeName 'System.DateTime' -MemberName '时辰' -MemberType 'ScriptProperty' -Value { $timeAliasArray='\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5' $hour = $this.Hour [int]$index=0 if($hour -eq 22){ $index=11 } else{ $index=[math]::Floor( (
下载地址
用户评论