解决方案
下面的代码是解决上一单元提出的挑战的可能解决方案。
$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-Host 和 Write-Output 来生成所需的输出。
Today's date is 10/05/2023.
Today is the day Chase began a PowerShell programming journey.
如果成功了,恭喜你! 请继续进行下一个单元中的知识检查。
重要
如果在完成此项挑战时遇到问题,那么最好先回顾前面的几个单元,然后再继续。 我们在其他模块中讨论的所有新内容都将取决于你对此模块中所介绍内容的理解情况。