我想获取HTML本地输出$htmlpart
。如何在“试用”部分编码?
https://(App Service name).scm.azurewebsites.net/
https://(App Service name).scm.azurewebsites.net/DebugConsole/?shell=powershell
(Get-Item D:\home\site\wwwroot\bin\Microsoft.Data.OData.dll).VersionInfo
$htmlpart
ProductVersion FileVersion FileName
-------------- ----------- --------
5.6.4.62175 5.6.4.62175 D:\home\site\wwwroot\bin\Microsoft.Data.OD...
$username = "(username)"
$password = "(password)"
$secpassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential($username, $secpassword)
Add-AzureRMAccount -Credential $Credential
Write-Output "Done: Add-AzureRMAccount"
$appservicename = "(App Service Name)"
$command = '(Get-Item D:\home\site\wwwroot\bin\Microsoft.Data.OData.dll).VersionInfo'
#
# I don't know how to deploy `$command` to `$appservicename`
# `$command` includes local path (D:\ ...) in `$appservicename` VM
#
$result = (Object shown in "Expected output" section)
$htmlpart = $result `
| Sort-Object -property FileName `
| ConvertTo-Html `
-Fragment `
-PreContent "<h4>file list</h4>" `
-Property * `
-As Table
$PsVersionTable
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.16406
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2