在IIS中调用Web应用程序的物理path凭据

如何使用PowerShell在IIS中调用Web应用程序的物理path凭据属性? 我无法打印出用户名或密码,但我可以打印使用相同属性的logonMethod ? 以下是我的Web应用程序的代码。 我曾尝试使用$webapp.virtualDirectoryDefaults并使用$webapp.userName但都不适用于Web应用程序。

  $webapps = Get-WebApplication -Site $Site.name foreach($webapp in $webAPPS) { Write-Host $webapp.applicationPool Write-Host $WebApp.virtualDirectoryDefaults.userName Write-Host $webapp.virtualDirectoryDefaults.password Write-Host $webapp.virtualDirectoryDefaults.logonMethod $webapp2 = $webapp.path Write-Host $WebApp2.split("/")[-1] "::: is the Web Application" -ForegroundColor Green }