小编PCP*_*aul的帖子

如果/ ElseIf阻止不使用-or

我正在为我儿子写的剧本有问题.我的意图是提醒他记住他的家务.我刚刚开始做PowerShell,我真的非常喜欢它.我已经买了几本书,还经历了很多其他的帖子.

到目前为止我所得到的是,似乎评估不能正常使用-or (或者我可能会这么做?)

    ## REMINDERS TO DO CHORES ##

$sun = "Sunday"
$mon = "Monday"
$tue = "Tuesday"
$wed = "Wednesday"
$thu = "Thursday"
$fri = "Friday"
$sat = "Saturday"

$today = (get-date).DayOfWeek

$choreVac = "Vacuum the rooms and stairs"
$choreBath = "Clean the Bathroom Including emptying the garbage"
$choreOther = "No Chores Today -- But keep dishes done up"


if($today -eq $mon -or $wed -or $fri) {
msg /time:2500 * "Today is a Chore Day:  your job is …
Run Code Online (Sandbox Code Playgroud)

powershell powershell-ise windows-10 powershell-5.0

3
推荐指数
1
解决办法
155
查看次数