Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying the following appcmd commnad:

appcmd list app /site.name:"misechko.com.ua-DEV" /xml | appcmd list vdir /in /text:physicalPath

misechko.com.ua-DEV is a correct site name in IIS. appcmd is registered in path;

I get the following error output when I am trying to execute a command in cmd.exe:

ERROR ( hresult:8007000d, message:The input contained an error element, which may indicate that the operationproducing the input has failed. )

What is the mistake in the app setup? I guess I am mixing a cmd and powershell approach, but the abocementioned script doesn't work in PowerShell either. A PowerShell way of getting the path by web site name is preferable.

P.S. My PowerShell alternative that also doesn't work:

$appCmd = "$Env:SystemRoot\system32\inetsrv\appcmd.exe"

$appcmd list app /site.name:"misechko.com.ua-DEV" /xml | $appcmd list vdir /in /text:physicalPath

Thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Researched myself and found an solution:

     function GetPhysicalPath ([String]$siteName) {

        function Get-PipelineInput
        {
            end {
                [xml]$appConfigXml = $input
                return $appConfigXml.application.virtualDirectory.physicalPath
            }
        }

        $appCmd = "$Env:SystemRoot\system32\inetsrv\appcmd.exe"  

        return & $appCmd list app /site.name:"$siteName" /config | Get-PipelineInput
    }
share|improve this answer
1  
If this was the solution, please accept it as the answer. –  Ryan Gates Dec 3 '13 at 21:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.