请观察:
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> $a
C:\Program Files\IIS Express\appcmd.exe
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:*
APP
path:"/"
APP.NAME:"MyDayforce/"
APPPOOL.NAME:"Clr4IntegratedAppPool"
SITE.NAME:"MyDayforce"
[application]
path:"/"
applicationPool:"Clr4IntegratedAppPool"
enabledProtocols:"http"
serviceAutoStartEnabled:"false"
serviceAutoStartProvider:""
preloadEnabled:"false"
[virtualDirectoryDefaults]
path:""
physicalPath:""
userName:""
password:""
logonMethod:"ClearText"
allowSubDirConfig:"true"
[virtualDirectory]
path:"/"
physicalPath:"C:\Dayforce\SharpTop\UI\MyWORKBits"
userName:""
password:""
logonMethod:"ClearText"
allowSubDirConfig:"true"
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:applicationPool
Clr4IntegratedAppPool
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list app "MyDayforce/" /text:enabledProtocols
http
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop>
我不知道如何显示physicalPath
的值。尝试了各种变体 - 没有任何作用。
那么,如何从app对象中获取physicalPath
?
P.S。
我知道如何从vdir对象中执行此操作:
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop> &$a list vdir /app.name:"MyDayforce/" /text:physicalPath
C:\Dayforce\SharpTop\UI\MyWORKBits
PS C:\Dayforce\DayforceRTQA\150520_747\SharpTop>
但是我对app对象有特别的兴趣,以便了解是否可以使用/text
标志获取嵌套属性。
答案 0 :(得分:8)
下午好,马克!
要仅使用app对象显示物理路径,可以使用[path='string']
语法引用它。使用此方法,您可以引用嵌套的VirtualDirectory
对象的所有属性。
因此,对于您的示例,您将使用以下命令:
&$a list app "MyDayforce/" /text:[path='/'].physicalPath
或更常见的默认IIS安装
C:\Windows\system32\inetsrv\appcmd.exe list app "Default Web Site/" /text:[path='/'].physicalPath