简体   繁体   中英

How to display the physical path of a web application using appcmd.exe?

Please, observe:

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>

I have no idea how to display the value of physicalPath . Tried all kinds of variants - nothing works.

So, how do I fetch the physicalPath from the app object ?

PS

I know how to do it from the vdir object:

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>

But I have a specific interest in the app object in order to understand whether nested properties can be fetched using the /text flag.

Good afternoon mark!

To display the physical path using only the app object you can reference it using the [path='string'] syntax. Using this you can reference all of the properties of the nested VirtualDirectory object.

So for your example you would use the following command: &$a list app "MyDayforce/" /text:[path='/'].physicalPath

Or more generally for default IIS installations

C:\\Windows\\system32\\inetsrv\\appcmd.exe list app "Default Web Site/" /text:[path='/'].physicalPath

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM