Update-TypeData -TypeName "System.DateTime" -MemberName "时辰" -MemberType "ScriptProperty" -Value {$timeAliasArray="子丑寅卯辰巳午未申酉戌亥"$hour = $this.Hour[int]$index=0if($hour -eq 22){ $index=11 }else{$index=[math]::Floor( ( $hour+1 ) % 23 / 2 ) } return $timeAliasArray[ $index ] + "时"}演示
PS> (get-date).时辰子时PS> $t=Get-Date -Hour 17PS> $t.时辰酉时总结