$a和之间有什么区别$b?
$a = (Get-Date).DayOfWeek
$b = Get-Date | Select-Object DayOfWeek
我试图检查
$a.GetType
$b.GetType
MemberType          : Method
OverloadDefinitions : {type GetType()}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : type GetType()
Name                : GetType
IsInstance          : True
MemberType          : Method
OverloadDefinitions : {type GetType()}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : type GetType()
Name                : GetType
IsInstance          : True
但是,尽管这些变量的输出看起来不同,但似乎没有什么区别。