【问题标题】:IIS new virtual directory. Getting "Parent node has no children of type virtualDirectory".errorIIS 新的虚拟目录。获取“父节点没有虚拟目录类型的子节点”。错误
【发布时间】:2018-02-15 23:04:28
【问题描述】:

我正在尝试使用以下 powershell 命令将我的 Web 项目文件夹作为虚拟目录添加到 IIS,但出现错误。想知道我是否遗漏了什么。谢谢。

PS C:\Users\Administrator> New-WebVirtualDirectory -name 'sy' -site 'sy site' -PhysicalPath 'C:\Projects\buoy'
New-WebVirtualDirectory : Parent node has no children of type virtualDirectory.
Parameter name: path
At line:1 char:1
+ New-WebVirtualDirectory -name 'sy' -site 'sy site' -PhysicalPath 'C:\ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-WebVirtualDirectory], ArgumentException
    + FullyQualifiedErrorId : Parent node has no children of type virtualDirectory.
Parameter name: path,Microsoft.IIs.PowerShell.Provider.NewVirtualDirectoryCommand

【问题讨论】:

    标签: windows powershell iis windows-server-2016


    【解决方案1】:

    当网站(例如“默认网站”)不存在时,我看到了这个错误。

    如果您使用不同的站点名称,请确保它存在于 IIS 中“站点”节点下的 Web 服务器上。那是您的错误所指的“父节点”。

    【讨论】:

      【解决方案2】:

      试试:

      New-WebVirtualDirectory -Site "Default Web Site" -Name Wyse -PhysicalPath C:\inetpub\wwwroot
      

      去了: https://docs.microsoft.com/en-us/powershell/module/webadminstration/new-webvirtualdirectory?view=winserver2012-ps

      并从 -name 和 -physicalpath 中删除引号并在 -site 上使用双引号,然后它就起作用了。我最初是在尝试 -site 'IIS:\Sites\Default Web Site'。希望这会有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多