解決方案

已完成

下列程式碼是針對上個單元挑戰的其中一個可能解決方案。

$date = Read-Host "What is today's date"
$name = Read-Host "Please enter your name"
Write-Output "Today's date is $date."
Write-Output "Today is the day $name began a PowerShell programming journey."

此程式碼只是「一種可能的解決方案」。 您的程式碼看起來可能不同。 不過,您撰寫了程式碼,應該已使用 Read-HostWrite-Output 來產生所需的輸出。

Today's date is 10/05/2023.
Today is the day Chase began a PowerShell programming journey.

如果成功,恭喜您! 請繼續進行下一個單元中的知識檢定。

重要

如果您無法順利完成此挑戰,建議您先複習前幾個單元中的內容再繼續。 我們在其他課程模組中討論的所有新想法,都取決於您對本課程模組中所呈現想法的理解。