我想检索与哈希表 TEST 中的特定项目关联的值,但它不起作用。你可以帮帮我吗?
$TEST=
@{"Monday" = "A"; "Tuesday" = "B"; "Wednesday" = "C"; "Thursday" = "D"; "Friday" = "F"}
$Date = Get-Date
$a = $TEST.Get_Item($Date.get_DayOfWeek())
Write-Host $a
也试试:
$TEST=
@{"Monday" = "A"; "Tuesday" = "B"; "Wednesday" = "C"; "Thursday" = "D"; "Friday" = "F"}
$Date = Get-Date
$a = $Date.get_DayOfWeek()
$b = TEST.Get_Item($a)
和:
$TEST=
@{Monday = "A"; Tuesday = "B"; Wednesday = "C"; Thursday = "D"; Friday = "F"}
$Date = Get-Date
$a = $TEST.Get_Item($Date.get_DayOfWeek())
Write-Host $a
非常感谢!