3

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 ?

P.S.

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.

mark
  • 59,016
  • 79
  • 296
  • 580

1 Answers1

10

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

Brian Gilreath
  • 643
  • 5
  • 10
  • Thank you very much. Could not figure it out. Do you happen to have a link to the respective documentation? Those pages I read about appcmd are very superficial and do not explain it. – mark Jun 15 '15 at 21:58
  • Sorry, I wish that I did have a link. I determined this solution a while ago during troubleshooting I was doing for a separate problem. I couldn't find anything but the Microsoft provided documentation as well :( – Brian Gilreath Jun 16 '15 at 15:09
  • How list apps: ***name, appPool and path*** ? – Kiquenet Jan 26 '18 at 09:15
  • **IMPORTANT** it seems the `/text` paramneeds to be enclosed in quotes and when it is not: `ERROR ( message:Malformed collection indexer; format is [@position,name='value',name2='value2',...].` i.e. `&$a list app "MyDayforce/" "/text:[path='/'].physicalPath"` – Yehuda Makarov Nov 09 '21 at 17:21