从App Service阅读

时间:2017-10-25 10:33:24

标签: xml powershell azure-web-app-service

我从App服务

获得了xml
$xml = (Get-AzureRmWebAppPublishingProfile -Name $webappname `
       -ResourceGroupName $myResourceGroup `
       -OutputFile null)

我的XML是正确的

<publishData>
  <publishProfile profileName="test1 - Web Deploy" publishMethod="MSDeploy" publishUrl="scm.azurewebsites.net:443" msdeploySite="test1" userName="$test1" userPWD="##############" destinationAppUrl="http://test1.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
    <databases />
  </publishProfile>
  <publishProfile profileName="test1 - FTP" publishMethod="FTP" publishUrl="ftp://ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="test1\$test1" userPWD="##############" destinationAppUrl="http://test1.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
    <databases />
  </publishProfile>
</publishData>

我尝试获取FTP帐户的密码

$password=$xml.SelectNodes("//publishProfile[@publishMethod=`"FTP`"]/@userPWD").value

我收到错误

Method invocation failed because [System.String] does not contain a method named
'SelectNodes'.
At line:1 char:1
+ $password=$xml.SelectNodes("//publishProfile[@publishMethod=`"FTP`"]/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

有人知道,为什么我会收到此错误?

0 个答案:

没有答案