YouhaveaWindowsPowerShellscriptthatcontainsthefollowingcode:import-csvAccounts.csv|Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword$_.password}Whenyourunthescript,youreceiveanerrormessageindicatingthattheformatofthepasswordisincorrect.Thescript

题目

YouhaveaWindowsPowerShellscriptthatcontainsthefollowingcode:import-csvAccounts.csv|Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword$_.password}Whenyourunthescript,youreceiveanerrormessageindicatingthattheformatofthepasswordisincorrect.Thescriptfails.Youneedtorunascriptthatsuccessfullycreatestheuseraccountsbyusingthepasswordcontainedinaccounts.csv.Whichscriptshouldyourun()

A.import-csvAccounts.csv Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword(ConvertHost-

B.import-csvAccounts.csv Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword(ConvertTo-

C.import-csvAccounts.csv Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword(Read-To

D.import-csvAccounts.csv Foreach{New-ADUser-Name$_.Name-Enabled$true-AccountPassword(Read-Host


相似考题
更多“YouhaveaWindowsPowerShellscriptthatcontainsthefollowingcode:import-csvAccounts.csv|Foreach ”相关问题
  • 第1题:

    7、有关对foreach语句描述不正确的是()

    A.foreach语句的语法为: foreach(type identifier in arrayName) {statement;}

    B.其中type和identifier分别表示迭代变量的类型和名称,arrayName表示要迭代的数组

    C.foreach语句只能用来访问数组元素

    D.可以在foreach语句体中改变迭代变量的值


    可以在 foreach 语句体中改变迭代变量的值

  • 第2题:

    9、有关对foreach语句描述不正确的是

    A.foreach语句的语法为:foreach(type identifier in arrayName){statement;}

    B.其中type和identifier分别表示迭代变量的类型和名称,arrayName表示要迭代的数组。

    C.foreach语句只能用来访问数组元素。

    D.可以在foreach语句体中改变迭代变量的值。


    A.可以在foreach语句体中改变迭代变量的值。

  • 第3题:

    7、foreach语句的语法如下,有关对foreach语句描述错误的是() foreach(type identifier in arrayName) {statement;}

    A.type和identifier分别表迭代变量的类型和名称,arrayName可表示要迭代的数组

    B.statement里可以用break语句或continue语句

    C.foreach语句只能用来访问数组元素或集合

    D.可以在foreach语句体中改变迭代变量的值


    foreach语句总是从索引1遍历到索引Length

  • 第4题:

    在数组中对于for 和 foreach 语句,下列那些选项中的说法不正确

    A.foreach语句能使你不用索引就可以遍历整个数组

    B.foreach语句总是从索引1遍历到索引Length

    C.foreach总是遍历整个数组

    D.如果需要修改数组元素就必须使用for语句


    B

  • 第5题:

    有关对foreach语句描述不正确的是

    A.foreach语句的语法为:foreach(type identifier in arrayName){statement;}

    B.其中type和identifier分别表示迭代变量的类型和名称,arrayName表示要迭代的数组。

    C.foreach语句不只能用来访问数组元素。

    D.可以在foreach语句体中改变迭代变量的值。


    A.可以在foreach语句体中改变迭代变量的值。