首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >“找不到驱动器。名为“IIS”的驱动器不存在。“

“找不到驱动器。名为“IIS”的驱动器不存在。“
EN

Stack Overflow用户
提问于 2018-07-13 08:24:22
回答 2查看 0关注 0票数 0

我编写了一个PowerShell脚本来自动部署IIS网站,但是当我将参数传递给脚本时,我收到以下错误:

找不到驱动器。名为“IIS”的驱动器不存在。

我的脚本(iss_website_version_update.ps1)如下所示,但请注意它还没有完成:

param(
[array]$iishostlist=$(throw "Parameter missing: -name iishostlist"),
[array]$websiteName=$(throw "Parameter missing: -name websiteName")
)

For($i=0;$i -lt $iishostlist.Count; $i++){
For($j=0;$j -lt  $websiteName.Count; $j++){
    $start = get-date
    $tempSession = new-pssession  -ComputerName  $($iishostlist[$i])
    Invoke-Command -Session $tempSession -ScriptBlock {
        C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -command Import-Module WebAdministration;set-location IIS:\;(Stop-Website $($websiteName[$j]))
        }
    .......

请让我知道为什么命令set-location IIS:\;中的子命令 Invoke-Command不被识别?

EN

Stack Overflow用户

发布于 2018-07-13 18:09:08

我有个模拟问题。错误是我没有在Admin模式下运行脚本。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100005577

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档